Opened 5 years ago

Closed 4 years ago

#15538 closed New feature (wontfix)

FetchFromCacheMiddleware ignore request header field cache-control

Reported by: jfp@… Owned by: nobody
Component: Core (Cache system) Version: 1.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



Cache-Control field contains in the request header is ignored by FetchFromCacheMiddleware.

So, for example, if the request contains "Cache-Control: max-age=0", the cached page is return instead of build a new version.

According to Cache-Control can be set on the erquest header and may be different from the Cache-Control of the reply.


Change History (2)

comment:1 Changed 5 years ago by lukeplant

  • Type set to Bug

comment:2 Changed 4 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Severity set to Normal
  • Status changed from new to closed
  • Type changed from Bug to New feature

I don't believe that Django's cache middleware listens to *any* of the request cache keys, and I'm not 100% sure it should. The goal of the cache framework (I think) isn't to compete with something like Varnish or Squid; I'm fairly sure doing something like this is out of scope.

I'm going to reject this, then, because making this change would be much bigger than just Cache-Control: we'd basically have to turn Django's cache middleware into a proper upstream cache. Feel free to suggest that change on django-dev, but my feeling is that's out of scope for Django.

Note: See TracTickets for help on using tickets.
Back to Top