This is an old revision of the document!


Turning On Maintenance Mode While LiteMage Is Enabled

If your Magento sites root directory, where index.php is located, contains a file named “maintenance.flag”, your Magento site is currently in maintenance mode and should display a 503 error page.

However, if a page is currently cached, LSWS will serve the cached copy instead, as it won't reach the backend to know that the site is in maintenance mode. This is often undesirable as the cached versions of these pages may become invalidated during maintenance and anything involving the backend will not work.

This leaves us with two possible scenarios:

1. You need to purge LiteMage Cache after maintenance

During maintenance, go to the Magento Admin Panel and navigate to System > Configuration > LITEMAGE CACHE > LiteMage Configuration, and set “Enable LiteMage Cache” to “No”. This will disable and automatically purge LiteMage Cache. Then, after removing the maintenance.flag file, re-enable LiteMage by changing “Enable LiteMage Cache” back to “Yes”.

2. You do not need to purge LiteMage Cache after maintenance

During maintenance, add the following rewrite rule to the beginning of your “.htaccess” file to have all requests for /index.php redirected to /errors/503.php instead:

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* errors/503.php [L, E=Cache-Control:no-cache]

Once maintenance has been completed, either remove or comment out this rewrite rule to restore your site back to it’s normal state.

  • Admin
  • Last modified: 2016/05/06 14:22
  • by Michael Alegre