-
Notifications
You must be signed in to change notification settings - Fork 77
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
Cacheback templatetag #71
Comments
I'm not sure if passing serializing the whole context can be done easily or fast enough. |
I agree - I am currently working on an implementation that passes just the original environment (which is easily serializable) to celery, which then triggers an entire page re-render in order to update the cache with the new values. This is obviously tricky and has potential to not play nicely with other apps, and can only be done for GET requests. I was also thinking about an implementation where you also pass in the context keys that need to be copied (or try to derive it automatically from the template parser) and only serialize that part of the context. I haven't tried this approach yet. |
Sounds complex to me. Feel free to build an proof of concept but I'm really not sure if this should land in cacheback. Maybe an extra library built up on cacheback? |
I would like a general purpose
cacheback
template tag that functions the same as the builtincache
template tag except uses cacheback to update the cache asynchronously. I started a branch to implement such a tag, but there is a major problem of serializing the context to send to celery to process. I cannot get it to serialize with cPickle at all and with regular pickle it took ~30 seconds which is clearly unacceptable and would require some sort of custom serializer to use pickle instead of cPickle. Does anybody have any ideas how we can serialize the request context to celery in a reasonable amount of time?The text was updated successfully, but these errors were encountered: