#23023 closed Cleanup/optimization (fixed)
Update warning about local-memory cache for sessions
Reported by: | Owned by: | Tim Graham | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I am suggesting an addition of a sentence to the warning about using the local-memory cache for caching sessions due to a tricky to replicate problem that I stumbled on. I started using cached_db ages ago but didn't configure the cache settings, leaving it as the default local-memory cache (In 1.2 it says that "This cache is multi-process and thread-safe", but that's not the case now. Oh wait, in 1.2, the next paragraph contradicts it's multi-process safeness - that's fixed now).
Mostly I'd sometimes notice that messages didn't appear until one or two pages after it should, but recently, I actually started using the session for more stuff and stuff was breaking sometimes and other times not - session looked good in the database, but my views weren't always seeing the same values. And everything was fine with runserver...
Doh! Multiple processes in WSGI/Apache2...
https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
So, just because the local-memory cache is the default if not otherwise configured, add an extra line to the existing warning:
Additionally, the local-memory cache backend is NOT multi-process safe, therefore probably not a good choice for production environments.
Change History (4)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In 7d0519c725f25cb0b52e42c60f2505e21d2ab4b3: