Symfony2 Home Page Checking HTTP Cache and Independently ESI

I am designing a project that has the same structure as a blog with Symfony2.

In my house, articles are displayed and there is a sidebar where there are links to enter the system or links to our account if we are registered.

My sidebar is ESI, my question is: if I set the verification cache on my home page (depending on the updated date of my last article), will the sidebar display its contents regardless of this cache? Otherwise, is there any other solution for this? (Configuring the article list as ESI, but does ESI have a validation cache?).

thank you for your responses

+4
source share
1 answer

Yes, it is possible that parts of the page are cached independently. It can be implemented by setting different headers in $ response:

$response->setPublic(); //or $response->setPrivate(); //or $response->setSharedMaxAge(600); 

A detailed answer to your question can be found on the Symfony2 documentation page.

+1
source

Source: https://habr.com/ru/post/1391098/


All Articles