#32055: Add Surrogate-Control header to the 304 response
-------------------------------+--------------------------------------
Reporter: bungoume | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by bungoume):
Taking the intent of rfc7232 section 4.1, it seems to me that we should
reduce the amount of data by excluding all but the headers related to the
cache.
Surrogate-Control is a cache control header that has been around for a
long time and is increasingly used in CDNs.
Its notations are the same as Cache-Control.
I think the reason it's not mentioned in rfc7232 is because it's only
recently started to be used.
This is used in cases where you want to keep browser cache control and CDN
cache control separate.
If Surrogate-Control disappears with 304, the CDN or proxy will use Cache-
Control as a cache control, and it won't do what you expect it to do.
To get around this, we''ll need to re-implement ConditionalGetMiddleware
on our own.
I believe it is more beneficial in many use cases to leave the headers in
place rather than erasing them based on rfc7232.
https://www.w3.org/TR/edge-arch/
https://docs.fastly.com/en/guides/configuring-caching#surrogate-control
--
Ticket URL: <https://code.djangoproject.com/ticket/32055#comment:2>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.88da75f542381bd18cb756254faba5bf%40djangoproject.com.