Tagging
Works with:
If your application has many intricate relationships between cached items, which makes it complex to invalidate them by route, cache tagging will be useful. It helps you with invalidating many-to-many relationships between content items.
Cache tagging, or more precisely Tagged Cache Invalidation, a simpler version of Linked Cache Invalidation (LCI), allows you to:
assign tags to your applications’s responses (e.g.,
articles
,article-42
)invalidate the responses by tag (e.g., invalidate all responses that are tagged
article-42
)
Hint
When working with Varnish, it is recommended to use the xkey vmod for efficient invalidation. See Tagging with Varnish and configure the proxy client for purgekeys.
Basic Configuration
First configure your proxy for tagging (Varnish, Symfony) and see if you want to adjust anything in the proxy client configuration. Then enable tagging in your application configuration:
fos_http_cache:
tags:
enabled: true
For more information, see tags.