在我前面的页面模板我使用缓存功能是这样的:如何在接收信号时过期django模板缓存键?
{% cache 86400 my_posts %}
{% get_latest_posts %}
{% endcache %}
当有一个新的岗位,我想过期缓存键;像这样:
def clear_post_cache():
cache.delete('my_posts')
post_save.connect(clear_post_cache, sender=Post)
我的问题是缓存密钥不能作为'my_posts'访问。我如何找到关键名称?