HttpCache: old version (page id 21987714)
Skip to end of metadata Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 3 Current »
Content Cache
Limitation
Icon
Shared HTTP cache is only available for anonymous users. Logged in users will be served the same cache as for anonymous users, except for restricted access.
For personal information display, you must use sub-requests with ESI or Hinclude. Sub-controller would not use cache or make the cached response vary with Cookie (individual cache).
Exponential uses Symfony HttpCache to manage content cache, with both expiration and validation model. Hence an ETag is computed for every content/version and sent in the Http response. It is also possible to use expiration model to get lightning fast responses.
An additional X-Location-Id header is added in the response for identification (see cache purge document).
Configuration
Making your controller content cache aware
Sometimes you need that your controller's cache expires in the same time than a specific content (i.e. ESI sub-requests with render twig helper, for a menu for instance). To be able to do that, you just need to add X-Location-Id header to the response object:
- No labels
Contributors
- Ricardo Correia
- Jérôme Vieilledent Updated
Comments
Add a comment