#1509 closed enhancement (fixed)
[patch] add anonymous-only caching to CacheMiddleware
Reported by: | matt | Owned by: | Jacob |
---|---|---|---|
Component: | Core (Cache system) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Here is a patch against trunk's django.middleware.cache.CacheMiddleware to optionally only cache anonymously requested (non-logged-in user) pages. Since rendered pages may contain user-specific information if they are logged in, caching those site-wide is often a bad idea. With this mdified middleware and CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
in your settings file, django can cache your non-logged in pages while serving up non-cached pages to logged in users.
I'm not a huge fan of CACHE_MIDDLEWARE_ANONYMOUS_ONLY
so if someone thinks of a better name for it, feel free.
Attachments (1)
Change History (3)
by , 19 years ago
Attachment: | anonymous_caching.patch added |
---|
comment:1 by , 18 years ago
I'm not a fan of this way of implementing this. I would prefer a view decorator function to indicate this sort of thing. It feels like more of a per-view thing than a per-project thing to me.
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch for caching anonymous-only