-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache is cleared on every launch #5
Comments
Indeed, I see no reason why that line couldn't be removed. |
I've thought of a slight caveat... I've just edited some templates and restarted. I now realise I also have to reset the cache too. So it needs to be clearly documented somewhere that a manual cache clear is needed in these situations. And probably a management command to make easy to do from the shell. |
Of course - there is also the scenario when you use something like django-compress with far-future cache headers. Normally django-compress will change the compressed filename so your compressed static files are fresh. However - with JimmyPage you'll get the cached version of the page with the urls for the old static files. So basically you need to increment the cache every time you change your static files. You probably also need to handle user-uploaded stuff. If you use something like django-filebrowser you'll want to listen for the file upload signal and potentially increment your cache then |
At the end of cache.py you call clear_cache()
This means the code runs on import and therefore everytime Django starts - even for management commands.
Is this necessary? I use several frequent cron tasks that run via management commands and I'm looking to minimise the number of times I start from a cold cache.
If I can safely remove this line then my cache will spend considerably longer warm.
The text was updated successfully, but these errors were encountered: