I am using the view cache for Django 1.10. But I am having problems clearing the cache.
@cache_page(60 * 30, cache="container_table")
def container_table(request, dataset):
# determine container_list by a query to the database
return render(request, 'container_table.html',{"container_list":container_list})
Then container_table.html creates a table involving container_list and each row has an element of container_list
along with a little checkbox
. When the checkbox
is checked
, I want the cache to clear. So essentially when the checkbox is checked, an ajax call is made to a view that does caches["container_table"].clear()
.
From the django docs, this should clear ALL keys in that cache, but it is not working because when I refresh the page for container_table.html it is still using a cache. Am I misunderstanding the usage of caches["container_table"].clear()
?
I thought it would clear everything!