#23054: Document limitations of cache middleware more clearly
-----------------------------------------+------------------------
Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Our documentation for the
[
https://docs.djangoproject.com/en/dev/topics/cache/#the-per-site-cache full-page-caching middleware] does not discuss Vary: Cookie at all, which
is a major omission. For most typical dynamic Django sites, every single
page served will rely on a user-specific cookie of some kind (whether that
be a session cookie, a CSRF cookie, a messages cookie, or a tracking
cookie (Google Analytics et al)). This means that (unless there is another
bug) the response should include Vary: Cookie, turning the full-page cache
into a per-user cache, dramatically ballooning its size-to-hits ratio,
which is almost certainly not what the developer expected or intended.
In my opinion this means that the cache middleware is simply not suitable
for use on most Django sites, which raises the question of whether it
belongs in Django at all. But at the very least this issue should be
clearly discussed in the documentation.
I can put together a pull request for this soon, just filing the ticket so
as not to lose track of it.
--
Ticket URL: <https://code.djangoproject.com/ticket/23054>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.