symfony: Esi cache broken ? (started session / private response)
Q | A |
---|---|
Bug report? | yes |
Symfony version | 3.4.6 |
Hello,
I just finished upgrading from Symfony 2.8 to 3.4.6, and my http cache is broken when using AppCache
(without debug).
It seems that since this PR, when the session is started, the response cache is set to private, which is fine.
But now when I go to a page where session is started and where I do render_esi(controller('MyBundle:Controller:action'))
, http cache is not working as before, because subrequests responses are made private even if I don’t start / use the session.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 20 (18 by maintainers)
Commits related to this issue
- feature #33663 [Security] Make stateful firewalls turn responses private only when needed (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Security] Make stateful fir... — committed to symfony/symfony by fabpot 5 years ago
- feature #33676 [Security] add "anonymous: lazy" mode to firewalls (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Security] add "anonymous: lazy" mode to firewalls ... — committed to symfony/symfony by chalasr 5 years ago
What if you use the firewall on the whole domain like:
^/
, but not every response is user specific. Our varnish caching stopped working after the upgrade to Symfony 3.4. Even when explicitly setting caching headers on the response, those are overwritten by the listener.For you shouldn’t the
controller()
specific call in the Twig template initiate a sub-request which the listener should ignore because it isn’t a master request?