I've got a pretty simple site where I'm using the page_cache
decorator.
I have a cronjob that checks for new data and processes it if it's available.
(This is run using management commands executed with crontab)
I want to then clear all the page caches when new data is processed.
I'm looking at the documentation here: https://docs.djangoproject.com/en/stable/topics/cache/
and found cache.clear()
, which seems to be what I want.
I've added a flag to the data processing portion and execute cache.clear()
when new data is found.
However, after the command runs the cache isn't cleared. (I've cleared the browser cached and checked to be sure it's not the browser)
Does cache.clear()
not work in to clear all cached pages?
I'm using the DatabaseCache
, so I guess I could go in and clear the cache table manually, but is there a better way?