Problem/Motivation
During a deploy in the production environment with the maintenance mode enabled, the Varnish server displays maintenance page instead of the cached page.
When you do a drush cache:rebuild, purge request are send to the Varnish server.
Steps to reproduce
During a deploy in the production environment, we do the following steps :
Enable maintenance mode
drush cache:rebuild
drush updatedb
drush config:import
drush cache:rebuild
disable maintenance mode
Proposed resolution
My opinion : Varnish should continue to serve cached pages (if in Varnish cache) during maintenance mode enabled.
To do that : adding an option to prevent purge request to be sended to Varnish server when maintenance mode is enabled.
if you want to purge all Varnish at the end of deployment script : disable maintenance mode, do the cache:rebuild after
or
if you want to check manually the result of your deploy : keep the maintenance mode enabled, check your backoffice, disable the maintenance mode, purge the whole site through the interface.
Remaining tasks
Unit tests
User interface changes
New option 'Prevent Varnish purge with Maintenance Mode' displayed in adv_varnish general options.
API changes
In CacheManage::sendRequest(), if the maintenance_mode and the puger_maintenance_mode are enabled, cancel the request.
Data model changes
New boolean value 'purge_maintenance_mode in cache_settings.general
Comment | File | Size | Author |
---|---|---|---|
#4 | 3182362-04.patch | 2.32 KB | benroy |
#3 | 3182362-01.patch | 2.32 KB | benroy |
Issue fork adv_varnish-3182362
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
benroy CreditAttribution: benroy at State of Geneva commentedThis is the patch
Comment #3
benroy CreditAttribution: benroy at State of Geneva commentedComment #4
benroy CreditAttribution: benroy at State of Geneva commentedFix error in sendRquest
Comment #5
David Castella CreditAttribution: David Castella commentedComment #6
benroy CreditAttribution: benroy at State of Geneva commentedComment #8
benroy CreditAttribution: benroy at State of Geneva commentedChanging status to "need_review", the patch to review is 4
Comment #10
shumer CreditAttribution: shumer as a volunteer commented