-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Caching behaviour with default settings #47
Comments
Have you tried setting a |
No, because the point I wanted to make is: "If my project does not use Django's Cache Framework at all, I will never think about changing the CACHES setting and that will break dbtemplates". If I make any use of Django caching in my project, I will definately use a cache backend thats works for my setup and then dbtemplates will of course work correctly. The documentation says (https://github.com/jezdez/django-dbtemplates/blob/develop/docs/advanced.txt#L7):
And:
What's missing is a clear indication that, If I do nothing, it will use CACHES['default'] and I have to make sure, that it's configured to work for my envirnoment. After reading the documentation I thought that dbtemplates would only use the cache, if I activated it somehow. But it does it silently by default. I opened the ticket because I think it might save others some time if this would be mentioned in the documentation. |
Ah, okay, thanks for the clarification, I'm sorry you had to find out that implicit behavior the hard way. This needs to be clarified indeed. |
@arneb thank you for this problem report, would you mind submitting a pull request against the current docs? |
Maybe this will be solved via PR #131 |
Since the introduction of the
CACHES
setting Django by default uses theLocMemCache
backend. Using multiple Django processes on the server, each process maintains it's own cache (as documented here: https://docs.djangoproject.com/en/1.6/topics/cache/#local-memory-caching).I think this yields to outdated templates in the cache of all processes, except the one, that was used to save a change through the Django Admin.
Setting
DBTEMPLATES_CACHE_BACKEND
toNone
does not change the behaviour.I think this behaviour needs to be documented, because I have to actively disable the LocMemCache setting to fix the problem with stale db-templates.
If I don't use caching at all in a project, I would normally not think about altering the Django default setting.
Environment: Django 1.6.2, Python 2.7.5, dbtemplates 1.3
Possibly related to #43
Edit: Using a
DummyCache
as the default cache fixed the problem with stale db-templates completely.The text was updated successfully, but these errors were encountered: