Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Fix response always private and overwritten if session is started#27282
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
… not be overwritten by the listener
nicolas-grekas commentedMay 18, 2018
This has been solved differently in#26681: the current behavior is considered correct (see links in linked PR), yet in very specific cases (e.g. session groups) it's OK to cache session accessing data. Thus 4.1 will provide a way to force caching session-using responses, as a new feature. |
stixx commentedMay 21, 2018
That solution isn't available yet in Symfony 3.4 as far as I can see. What do you require for this solution to come for 3.4?:
|
nicolas-grekas commentedMay 21, 2018
#26681 is a new feature, so cannot go on 3.4. Options 1. or 2. are the ones. |
HypeMC commentedMay 23, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas I'm really disappointed to hear this. I just upgraded Symfony from 3.3 to 3.4 & ESI caching completely stopped working. I understand that no new features will be added to 3.4 anymore, but this seems to go against the BC promise. Would be great if some fix was provided for 3.x. Dunno, maybe I'm wrong about the BC promise, but it looks like a big change for a minor version. |
EmmanuelVella commentedJun 4, 2018
@nicolas-grekas From symfony 3.4, current doc won't work if the firewall is enabled on theses actions (http://symfony.com/doc/3.4/http_cache/esi.html). So what is the way to make it work in this case ? Excluding corresponding actions in the security.yml file ? This would be hard to maintain when having, for example, many actions and using i18n routes. |
nicolas-grekas commentedJun 4, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@EmmanuelVella if you mean having cached fragments while using |
This PR resolves thebug where the response caching directives where always overwritten in the master request by the listener even if the controller response was trying to set caching directives. This fix adds an additional check in the listener to check if the response was cacheable at first.