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
Add Fastly support #597
Add Fastly support #597
Conversation
Okay, that's all I think. Would be possible to split Cache-Control and Surrogate-Control, but don't know how and currently I'm configuring this using vcl. In Fastly you can specify the Cache-Control for the cache using Surrogate-Control-Header and Cache-Control-Header to control the users browser cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot! this looks good - i only commented some details to tweak the doc and such.
for the documentation, can you please add the cross-linking in places it is missing?
- https://foshttpcachebundle.readthedocs.io/en/latest/features/invalidation.html
- https://foshttpcachebundle.readthedocs.io/en/latest/features/tagging.html (as there are things about xkey, i think fastly supports cache tagging)
can you please add a section for what fastly configuration to do for cache tagging and the other functionality? lets not make it a fastly tutorial, but specify the specific vcl bits for each functionality - probably quite similar to the varnish proxy configuration chapter :
https://foshttpcache.readthedocs.io/en/latest/proxy-configuration.html
user context caching could probably be made to work as well, as fastly is based on varnish and offers custom VCL. but that would need to be tested out - we can skip it for now.
Okay, did the code changes.
So you want me to create a PR in the FosHttpCache Repo which creates a Fastly config section? |
oh, sorry did not realize that i switched the repository while looking at the documentation. i created FriendsOfSymfony/FOSHttpCache#546 - if you want to work on it, please do of course, but its not in this pull request. |
thanks a lot! |
Will do once I've finished my integration completly and have a better understanding of fastly. I could imagine there are more pitfalls than I know so far ;-) E.g. Fastly uses more than one Cache-Control. Surrogate-Control: Controls the Cache of Fastly. At the moment I'm copying the Cache-Control to Surrogate-Control in vcl_fetch and set Cache-Control to "no-store". |
awesome, looking forward to that! regarding surrogate-control: there is a discussion about bringing support for that directly into the symfony Response object: symfony/symfony#47288 that would be the best solution for this. it would be possible to create custom headers for it in FOSHttpCacheBundle but it would be more elegant if its in symfony itself. either way we could start implementing configuration for it in the bundle and then depending on the symfony version set a custom header or use the official header once symfony supports it. |
This PR adds the support for Fastly.
Please take a closer look at the .rst-files cause I wasn't able to find a working editor.