【发布时间】:2021-05-10 16:52:13
【问题描述】:
我正在使用 Django CACHEOPS。 cacheops' README
在 settings.py 中如何为不同的查询集配置不同的超时时间?
(缓存 get 查询集 10 秒,缓存 queryset fetches 60 秒)
类似这样的:(这显然有重复密钥错误)
CACHEOPS = {
'blog.Article': {'ops': 'fetch', 'timeout': 60},
'blog.Article': {'ops': 'get', 'timeout': 10},
}
我的目标是:我想缓存每篇文章详细页面比文章列表页面更长的时间。
【问题讨论】:
标签: django caching redis django-redis