cache_page decorator sets wrong Cache-Control header
|Reported by:||Owned by:||Tomáš Kopeček|
|Component:||Core (Cache system)||Version:||master|
|Cc:||permonik@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If trying to set cache_page with CUSTOM_SECONDS, the CACHE_MIDDLEWARE_SECONDS Cache-Control header will look like:(notice the underscore)
Cache-Control: max_age=CUSTOM_SECONDS, max-age=CACHE_MIDDLEWARE_SECONDS
The first problem is that patch_cache_control changes existing values to underscores, but never changes them back, and this is what the patch addresses.
The second problem is that even with this fixed, the max-age will still be set (appended to the existing value) to the default CACHE_MIDDLEWARE_SECONDS, probably later on by the cache middleware.
Change History (15)
comment:1 Changed 9 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Ready for checkin|