UpdateCacheMiddleware does not save responses for HEAD requests
|Reported by:||codemonkey||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||master|
|Severity:||Keywords:||cache HEAD middleware|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you are sending HEAD request to your application, response won't be cached.
But if you are sending GET request first, response will be cached and following HEAD request will be answered directly from cache.
According to the comment in UpdateCacheMiddleware's process_response() method, this behaviour depends on inexistent HTTPMiddleware. Due to the fact that response content for HEAD requests is throwed away by response fixers after all middlewares are applied, it could be safely dropped.
Patch that fixes caching of HEAD requests is attached to this ticket.
Change History (7)
comment:1 Changed 6 years ago by Honza_Kral
- Keywords middleware added
- Needs documentation unset
- Needs tests set
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted
Changed 6 years ago by codemonkey
comment:5 Changed 6 years ago by Honza_Kral
- Resolution set to fixed
- Status changed from new to closed