I'm using Django CACHEOPS. cacheops' README
In settings.py how can I config different timeouts for different querysets?
(cache the get
queryset for 10 seconds and cache queryset fetches
for 60 seconds)
Something like this: (This obviously has duplication key error)
CACHEOPS = {
'blog.Article': {'ops': 'fetch', 'timeout': 60},
'blog.Article': {'ops': 'get', 'timeout': 10},
}
My goal is: I want to cache each article detail page longer than the article list page.
As you see a key in
CACHEOPS
definition is for models, not for querysetblog.Article
is aArticle
model in ablog
application, not a queryset.Then knowing the above you have only workarounds for a glitch in the cacheops and it would be
Rather use decorator to cover specific
get
on a specific model: