CacheMiddleware should respect max-age
|Reported by:||SmileyChris||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||master|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This came up in IRC today, someone (K0001) wanted to use the per-site middleware but disable caching for a specific view. It seems like the django.views.decorators.cache.never_cache decorator should work but it wasn't.
The reason is because currently the cache middleware doesn't bother looking to see if an expiry age was set by the response, it just uses the CACHE_MIDDLEWARE_SECONDS setting.
Change History (5)
Changed 7 years ago by SmileyChris
comment:1 Changed 7 years ago by SmileyChris
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 7 years ago by anonymous
- Triage Stage changed from Unreviewed to Ready for checkin