UpdateCacheMiddleware does not save responses for HEAD requests
|Reported by:||Maxim Bublis||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
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|