#20459: Better example for setting header fields in documentation
--------------------------------------+--------------------
Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
I think the current example for setting header fields in HttpResponse
objects is a bit unfortunate:
https://docs.djangoproject.com/en/dev/ref/request-response/#setting-
header-fields
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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.