The Cache-Control field (also the Vary field) is a comma-separated multi
value field.
e.g. `Cache-Control: public, max-age=60`
Setting its value by a dictionary access can unintentionally remove other
present values, e.g. set by another middleware.
My proposed solution: change example to use 'Age' header field, mention
and encourage use of patch_vary_header and patch_cache_control methods.
https://github.com/bbjay/django/commit/227f4bf4fe7971754ecc09aeb141b824a3f0550b
--
Ticket URL: <https://code.djangoproject.com/ticket/20459>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:1>
Comment (by tadeck):
That fix looks nice. Would you care to create pull request etc., or should
someone else do that?
--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:2>
Comment (by bbjay):
Cool. Yes, i will gladly do that, just wanted to hear another opinion
before filling a PR.
btw: do i need to set myself to cc to get updates for this ticket by
email?
--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:3>
* cc: bbjay (added)
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/1174
--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"e83ff42792eb52235cacda58f3441673cc4e4c94"]:
{{{
#!CommitTicketReference repository=""
revision="e83ff42792eb52235cacda58f3441673cc4e4c94"
Fixed #20459 - Improved example for setting HTTP header fields.
Thanks Jérémie Blaser.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:5>