-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Cache][HttpKernel] Fix #[Cache] overrides controller no-store directive
#62708
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
[Cache][HttpKernel] Fix #[Cache] overrides controller no-store directive
#62708
Conversation
#[Cache] overrides controller no-store directive# overrides controller no-store directive
|
As I wrote on the linked PR:
So thanks for opening if this needs to be discussed. Here is my reasoning:
|
# overrides controller no-store directive#[Cache] overrides controller no-store directive
Thanks @nicolas-grekas ! symfony/src/Symfony/Component/HttpKernel/Attribute/Cache.php Lines 15 to 17 in 0dd7d93
Attributes define defaults, controllers have the final say, at least that's what I understood. When a controller explicitly adds |
|
@smnandre can you help us on this one since you added support for no-store on the cache attribute? |
|
I'm trying to get a good comprehension of the issue here, reading the changes made since. #62488 without something similar for no-store could not bring coherent results now indeed. But I don't see how checking the header bag in foreach.. loops could be fully working, as multiple response setter act on two different headers, so one may just be decided by the other. That beein said, I agree I did not implement it as "default header".. as I in fact never anticipate the usage of setting no-stiore "per default" and remove it explicitely later. But that was the same for public/private, no ? |
|
@ayyoub-afwallah I'm curious too to understand the use case for Here it would make no difference if you removed the attribute entirely. |
Related to #62488
Using no-store still overrides the controller
Expected :
Cache-Control : no-store, privateResult :
Cache-Control : no-cache, private