-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Surrogate-Control across all backends instead of custom X-Reverse-Proxy-TTL #455
Comments
i assume its more complicated than allowing to change the header name, as surrogate-control will need some additional thing to tell that the number is the ttl on that cache? there seems to be discussions on how varnish itself should support the surrogate-control header: varnishcache/varnish-cache#2893 making the thing more flexible definitely sounds like a good idea. for varnish, we might want to wait for them to decide how to handle it, to avoid having our custom thing that is different from how varnish works. (there is also stuff about handling surrogate names so that the application could target only some of the surrogates and whatnot. not necessarily something we have to support right away, but something to keep in mind with the solution that we come up with.) i guess ttl should move out of the cache control listener, or be injected as a strategy so we can have the current behaviour or the fastly one or maybe a future thing for varnish with surrogate-control. |
After having read that, I guess it's indeed best to drop the 3 item for now. The main needs are 1. is to be able to not use Adds up on your side? :) |
Yep, fully agree!
… |
after discussion at symfony/symfony#41369 , an additional thing to think about is that the |
Depends on what you mean, but I can't see any mention of Age here: But indeed seems this is a known issue when letting reverse proxy cache for long time: Ideally browsers should have some heuristics to prefer other headers then Age if set, but possible fix for this is unsetting Age in VCL, or rename it so you can still see age of cache for debugging issues. EDIT: Or other client headers should be used here, ref question if stale headers might work better on the symfony PR. |
Find this very interesting Topic! Do we know if I found some more resources about this topic about another header
Requested the state of the CDN-Cache-Control via Twitter here: https://twitter.com/alex_s_/status/1557679407531171843 some interesting links from fasly yet. They currently supporting Surrogate-Control but not yet the CDN-Cache-Control. |
oh, that twitter discussion looks quite interesting. if we add flexibility in this regard, adding Surrogate-Control support additionally seems not wrong and probably not too complicated. but the -cache-control draft looks promising. your tweet only got responses from fastly until now... would indeed be interesting to know if the draft can make it into a proper RFC... implementing something that might still change when the RFC is formalized is a bit unfortunate, but with the necessary disclaimers i think it should be ok to do it. i wonder if the symfony httpcache itself should consider itself a CDN and implement this as well? possibly also registering SymfonyCDN-Cache-Control? (but that discussion is out of scope here) |
Cloudflare did response with support for the The rfc called Cloudflare docs: https://blog.cloudflare.com/cdn-cache-control/ |
ah, that is excellent news! lets open a new issue to implement RFC-9213 and deprecate x-reverse-proxy-ttl then! we will need to make the header name configurable because it could be a vendor-specific name - when we do that, we can simply allow to specify "Surrogate-Control" as well to cover this story. (though i read the twitter thread as saying that fastly will eventually support the new RFC 9213 as well) are you interested in working on that? |
I opened an issue in the Symfony Core: symfony/symfony#47288 I think it would be great if the HttpFoundation component allow us easier set and manipulate this headers. |
As discussed in the original Fastly PR in order to generalize TTL handling across backends like Varnish, Fastly, Symfony, it could be an idea to:
If feasible look into also emit Surrogate-Control on Varnish instead ofX-Reverse-Proxy-TTL
, VCL could still handle forX-Reverse-Proxy-TTL
for BC.https://www.w3.org/TR/edge-arch/
The text was updated successfully, but these errors were encountered: