Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Don't send default cache header for 301 redirects#18220
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
| thrownew \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).',$status)); | ||
| } | ||
| if (301 ==$status && !array_key_exists('cache-control',$headers)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not sure if it's correct place for this code. Looking forward for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would instead move this into the main Response class just before sending the headers to the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@fabpot, in Response class headers already computed and contains unnecessary 'no-cache' directive. We can't check wether is was set automatically or explicitly by user. see\Symfony\Component\HttpFoundation\ResponseHeaderBag::computeCacheControlValue
e-moe commentedMar 18, 2016
probably we can add then, in
|
fabpot commentedJun 15, 2016
I'm going to merge this as is. |
fabpot commentedJun 15, 2016
Thank you@e-moe. |
This PR was merged into the 3.2-dev branch.Discussion----------Don't send default cache header for 301 redirects| Q | A| ------------- | ---| Branch? | "master"| Bug fix? | no| New feature? | yes| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17139| License | MIT| Doc PR | see comments from#17139Commits-------cf253a9 17139: do not send default cache header for 301 redirects
Uh oh!
There was an error while loading.Please reload this page.