Per-site cache docs vague about which middleware sets headers
|Reported by:||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The docs currently say:
Additionally, the cache middleware automatically sets a few headers in each HttpResponse:
Sets the Last-Modified header to the current date/time when a fresh (not cached) version of the page is requested.
Sets the Expires header to the current date/time plus the defined CACHE_MIDDLEWARE_SECONDS.
Sets the Cache-Control header to give a max age for the page – again, from the CACHE_MIDDLEWARE_SECONDS setting.
It's no longer clear which middleware does that, because these days what was once
CacheMiddleware is now recommended as two separate components,
FetchFromCacheMiddleware. It is the UpdateCacheMiddleware that is responsible for modifying the Response's headers.
And, if being really picky:
The cache middleware caches GET and HEAD responses with status 200, where the request and response headers allow
This is dictated by the FetchFromCacheMiddleware at the beginning of the request