-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(doc): add more information on Fastly tag keys #591
Conversation
@@ -13,7 +13,7 @@ Tagging | |||
~~~~~~~ | |||
|
|||
Fastly supports cache tagging out of the box. | |||
Configure the tag header to ``Surrogate-Key``. (``fos_http_cache.tags.response_header`` if you use FOSHttpCacheBundle) | |||
Configure the tag header to ``Surrogate-Key``. (``fos_http_cache.tags.response_header`` as well as ``fos_http_cache.tags.separator`` to `` `` if you use FOSHttpCacheBundle) |
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.
Configure the tag header to ``Surrogate-Key``. (``fos_http_cache.tags.response_header`` as well as ``fos_http_cache.tags.separator`` to `` `` if you use FOSHttpCacheBundle) | |
Configure the tag header to ``Surrogate-Key`` and the separator to `` `` (empty string). | |
If you use FOSHttpCacheBundle, this can be done in the bundle configuration: | |
.. code-block:: yaml | |
fos_http_cache: | |
tags: | |
response_header: Surrogate-Key | |
separator: ' ' | |
If you do not use the bundle, you need to pass your own instance of the TagHeaderFormatter with the right options to the ResponseTagger:: | |
use FOS\HttpCache\ResponseTagger; | |
use FOS\HttpCache\TagHeaderFormatter\CommaSeparatedTagHeaderFormatter; | |
// ... | |
$tagger = new ResponseTagger([ | |
'header_formatter' => new CommaSeparatedTagHeaderFormatter('Surrogate-Key', ' '), | |
]); |
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! i never used fastly myself, maybe the person contributing this did not remember to document it.
i suggest we make this a bit more verbose while we are at it, to provide the full information.
I will, let me come back to this PR soon if accepted, I will rewrite this PR to document both config when using the sf bundle |
closing, I will try to open a PR to document this separator as well as the new bundle config of ttl header name |
we could have merged this and do a separate PR for the ttl header name... but now that its closed you can also do it all in one PR :-) |
Hey, here is a PR after #588
so it could be wise to state it here :) (instead of default
Fastly needs a separator
,
)https://www.fastly.com/documentation/reference/http/http-headers/Surrogate-Key/
wdyt? thank you,