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.
精彩评论