Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caching of calculated properties #30

Open
hitz opened this issue Apr 17, 2017 · 1 comment
Open

caching of calculated properties #30

hitz opened this issue Apr 17, 2017 · 1 comment

Comments

@hitz
Copy link
Member

hitz commented Apr 17, 2017

According to @lrowe , calculated properties should be cached and not re-calculated, but @j1z0 with 4dn has reported that they are always calculated.

Let's start by writing a test in snovault to prove this behavior. There are multiple caching mechanisms, but the one that matters is elasticsearch.

It might make sense to actually have calculated properties NOT be indexed in elasticsearch as long as GET/calculate is efficient enough; this could allow us to connect to linked objects that are never embedded and hence will not invalidate the parent object on update.

@lrowe
Copy link
Member

lrowe commented Apr 17, 2017

The category argument of calculated_property determines which 'frame' it will end up in. It defaults to object which means it ends up being cached as that frame is stored in elasticsearch.

The elastic search caching is implemented as object and expand views which override rendering for results that come from elastic search in cached_views.py.

To avoid any caching use @calculated_property(category='page') like here in resources.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants