开发者

Django template reading wrong cache value

I am caching in my django template like this.

{% load cache %}
{% cache cache_timeout key_name model_id %}
    <div>          
       {{some_variable}}
    </div>
{% endcache %}

Where cache_timeout is a variable I set in the view with the timeout.

I am also manually changing the cache value using the snippet on the accepted answer to this question

It is working fin开发者_JAVA技巧e as I know the template sets the value with the same key I use. The thing is that when I update the cache (I am checking the updated value and it is the one I set) the template keeps showing the previous value for some time(way smaller than the timeout) before updating.

I need the template to update the value read immediately.


Check the HTTP headers that are coming back with the response. Sounds like browser caching.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜