Replies: 1 comment 1 reply
-
probably you can mark your pages with some prefix
OR you just find the exact cache key for your url by calling _generate_cache_key with some mock request.url or somethng basically your problem is that default cache_page is too smart - maybe it's easiter to do some custom cache_page function |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
Have been struggling with caching methods. It seems
@cache_page
works best, its given the fastest responses by far. The only problem is I'm unable to invalidate it.I can manually cache with
cache.set()
andcache.get()
- but I can't seem to be able to set the validated models. I've tried caching just the values to avoid caching aQuerySet
and that seems to work alright, it is just about 20-30ms slower than the response of@cache_page
I also have some complex resolver methods as part of my Schema and those seem to break when using cached values. I've disabled them just for testing but it is another problem I run into.
So, I guess my question is mostly about how to cache the "static" response to a key and return that response without any additional processing.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions