-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Don't disable FPC for maintenance, instead send "no cache" headers #25790
Don't disable FPC for maintenance, instead send "no cache" headers #25790
Conversation
Hi @Parakoopa. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
a134587
to
72c0e05
Compare
@magento run Unit Tests |
After a recommendation by @sivaschenko, I changed it so, that public headers aren't even set in maintenance mode. |
7cde7ce
to
0179004
Compare
@@ -1,74 +0,0 @@ | |||
<?php |
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.
Please revert changes in this file as this is not observer and removing it will be backward incompatible. If it’s not used anymore - please mark it with tag @deprecated
with description why it was deprecated.
/** | ||
* @var \Magento\Framework\App\MaintenanceMode|\PHPUnit\Framework\MockObject\MockObject | ||
*/ | ||
protected $maintenanceModeMock; |
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.
Please make it private
…ublic cache headers - Removes the observer for disabling and re-enabling the FPC during maintenande mode switch - Disables setting public cache headers, if maintenance mode is enabled - phpcs:ignore entries were added in places where no actual code was changed by this commit, but static tests failed
0179004
to
acd42b8
Compare
Hi @ihor-sviziev, thank you for the review. |
✔️ QA Passed |
Hi @Parakoopa, thank you for your contribution! |
Description (*)
This Pull Request removes the need to have a writable env.php while switching the maintenance mode. Previously Magento tried to disable the FPC when switching into maintenance mode. This removes that and instead, to maintain functionality, sets the "no-cache" headers for all frontend requests in maintenance mode (
Cache-Control
etc.). The effect is, that pages are not cached while in maintenance mode.Removes the observer for disabling and re-enabling the FPC during
maintenande mode switch
Adds a new observer, that adds the "no cache" headers for all HTTP
requests during maintenance mode
Fixed Issues (if relevant)
Manual testing scenarios (*)
With Builtin FPC:
Repeat tests for Varnish as FPC.
Contribution checklist (*)