{"action":"opened","issue":{"url":"https://api.github.com/repos/davidalger/devenv/issues/106","repository_url":"https://api.github.com/repos/davidalger/devenv","labels_url":"https://api.github.com/repos/davidalger/devenv/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/davidalger/devenv/issues/106/comments","events_url":"https://api.github.com/repos/davidalger/devenv/issues/106/events","html_url":"https://github.com/davidalger/devenv/issues/106","id":315312759,"number":106,"title":"Flush cache immediately after site is put in maintenance mode","user":{"login":"erikhansen","id":129031,"avatar_url":"https://avatars2.githubusercontent.com/u/129031?v=4","gravatar_id":"","url":"https://api.github.com/users/erikhansen","html_url":"https://github.com/erikhansen","followers_url":"https://api.github.com/users/erikhansen/followers","following_url":"https://api.github.com/users/erikhansen/following{/other_user}","gists_url":"https://api.github.com/users/erikhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/erikhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikhansen/subscriptions","organizations_url":"https://api.github.com/users/erikhansen/orgs","repos_url":"https://api.github.com/users/erikhansen/repos","events_url":"https://api.github.com/users/erikhansen/events{/privacy}","received_events_url":"https://api.github.com/users/erikhansen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T03:01:32Z","updated_at":"2018-04-18T03:01:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I would recommend adding a cache flush immediately after the `magento:maintenance:enable` command runs when doing a deployment:\r\n\r\n![21-22-12 1 ruby-ucw21](https://user-images.githubusercontent.com/129031/38908359-6b206792-4285-11e8-957f-91360db14180.jpg)\r\n\r\nThe reason for this is that many pages will be cached in Varnish, and if a user tries to do anything with those pages that requires interaction from the server (e.g., add a product to the cart), they will get an error or a spinner that never goes away. And so rather than providing an inconsistent experience to users, it seems that putting all pages in maintenance mode will avoid confusion as you're upfront with the user about the site being offline.\r\n\r\nI'm currently in the middle of deploying an update to a server, updating Magento 2.1.x to 2.2.x. The `magento:setup:db:data:upgrade` step is going to take about 30 minutes due to the size of the merchant's database. To avoid the inconsistent experience mentioned above, I flushed the cache on the server right after the `magento:maintenance:enable` step. It's far more common for the site to only be in maintenance mode for a couple of minutes, but my point stands that it provides the most consistent experience to flush the cache immediately after the site is put _into_ maintenance mode, not right after it's taken _out of_ maintenance mode."}}
{"actor":{"display_login":"erikhansen"}}