Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:cache:litemage:troubleshooting:turning-on-maintenance-mode [2016/05/06 14:22] Michael Alegre created |
litespeed_wiki:cache:litemage:troubleshooting:turning-on-maintenance-mode [2016/05/09 21:02] Long Hu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Turning On Maintenance Mode While LiteMage Is Enabled ====== | + | ====== Site Abnormal After Store Maintenance with LiteMage Enabled ====== |
- | If your Magento sites root directory, where index.php is located, contains a file named “maintenance.flag”, your Magento site is currently in [[https://www.siteground.com/tutorials/magento/maintenance-mode.htm|maintenance mode]] and should display a 503 error page. | + | **Problem**: Some Magento site ESI blocks showing abnormal content after Magento store maintenance |
- | 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. | + | **Cause**: User forgot to disable LiteMage during store maintenance. During maintenance, Magento site couldn't be accessed (return 503 error) while LiteMage is still working if not disabled. If any site page caches are refreshed during this period, the wrong content from backend will be cached and be served later, which caused the problem. |
- | This leaves us with two possible scenarios: | + | **Solution**: Flush All LiteMage Caches and rebuild the cache. Go to Magento Admin Panel and navigate to System > Cache Management, click "Flush All LiteMage Cache". |
- | **1. You need to purge LiteMage Cache after maintenance**\\ | + | **Notes**: Please disable LiteMage during store maitenance period. Or use the following alternatives if your maintenance won't affect the site content: |
- | 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”. | + | 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: |
- | + | ||
- | **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_URI} !^/(media|skin|js)/ | ||
Line 21: | Line 17: | ||
RewriteRule .* errors/503.php [L, E=Cache-Control:no-cache] | 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. | + | Once maintenance has been completed, either remove or comment out this rewrite rule to restore your site back to it’s normal state. In this way you can avoid the purge of LiteMage cache and the cost to rebuild cache. |
+ | |||
+ | |||