Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:cache:litemage:troubleshooting:no-cache-hit-header [2017/05/05 20:39]
Lisa Clarke
litespeed_wiki:cache:litemage:troubleshooting:no-cache-hit-header [2018/08/07 17:49]
Jackson Zhang
Line 1: Line 1:
-~~NOTOC~~+====== No “X-LiteSpeed-Cache:​ hit,​litemage” Header ======
  
-====== “X-LiteSpeed-Cache:​ hit,​litemage” Header Not Appearing (Magento ​1.x) ======+In a Magento 1.x store, if the ''​X-LiteSpeed-Cache:​ hit,​litemage''​ header is missing, it may be an indication that LiteMage is not working properly. There can be various causes for this problem, but most likely a step was missed in the [[litespeed_wiki:​cache:​litemage:​installation|LiteMage ​1.x Installation Guide]].
  
-==== Symptoms ==== +Go through this listchecking each item until you find what may be causing the problem.
-''​X-LiteSpeed-Cache:​ hit,litemage''​ header is missing (LiteMage is not working properly) ​+
  
-==== Cause ==== +===== Do you see ''​X-Litespeed-Cache:​ miss''?​ ===== 
-There can be various causes for this problembut most likely ​step was missed in the [[litespeed_wiki:​cache:​litemage:​installation|LiteMage 1.x Installation Guide]].+This header indicates 4 things: 
 +  - LiteMage is working 
 +  - It didn't find the page in the cache. 
 +  - When it loaded the page to display ​this timeit also cached ​copy.  
 +  - The next time you load the page, it will be served from cache
 +   
 +If you see this header, refresh the page and check again. You should then see the ''​X-LiteSpeed-Cachehit,litemage''​ header.
  
-==== Solution ​=== +===== Is LiteMage Enabled... ===== 
-Please double check the following: ​+==== For Your License? ==== 
 +For 1-CPU and lower licenses, you will need to purchase LiteMage as an add-on, while LiteMage starter is included in all 2-CPU and above license. If you just recently upgraded your license by adding LiteMage, you will need to register a new license key with the ''​.../​lsws/​bin/​lshttpd -r''​ command and then restart LSWS.
  
-  * Do you have LiteMage enabled for your licenseFor 1-CPU and lower licenses, you will need to purchase LiteMage as an add-on, while LiteMage starter is included in all 2-CPU and above license. If you just recently upgraded your license by adding LiteMage, you will need to register a new license key with command ''​.../​lsws/​bin/​lshttpd -r''​ and restart LSWS. +==== In Your Configuration==== 
-  * Do you see ''​X-Litespeed-Cache:​ miss''?​ If yes, just refresh the page again and it will be served from LiteMage. +Have you added ''​LiteMage On'' ​to your store'​s ​''​.htaccess'' ​file? 
-  * Have you placed ​''​LiteMage On'' ​in your store'​s .htaccess file? + 
-  * Do you host your Magento store on a shared hosting service account? Please ​contact your hosting company to ensure that they have enabled LiteMage for your account. +==== in Magento? ==== 
-  ​* ​Have you or your host set the server & virtual host level cache root and cache policy? +Has **Enable LiteMage Cache** been set to ''​Yes''​ under **LiteMage Configuration** in the Magento admin? 
-  * Has **Enable LiteMage Cache** been set to ''​Yes''​ under **LiteMage Configuration** in the Magento admin+ 
-  ​* ​Have other full page caches been disabled? +===== Do You Use Shared Hosting? ===== 
-  ​* ​If you have set **Enable LiteMage Cache Only for Listed IPs**, is your IP listed? +If you host your Magento store on a shared hosting service account, please ​contact your hosting company to ensure that they have enabled LiteMage for your account. 
-  ​For LiteMage to work correctly, you must have both **Configuration** and **Layouts** enabled under **System → Cache Management**. If you are using Magento Enterprise, you must also disable **Page Cache**. + 
-  ​* ​Did you try flushing LiteMage Cache and Magento Cache Storage?+===== Are Some Pages Cached? ===== 
 +If some pages are cached but others are not, you may have reached your license'​s cache object limit. In that case, you will need to upgrade LiteMage to a higher tier. 
 + 
 +===== Are Cache Root and Cache Policy Set Up? ===== 
 +Have you or your host set the server-level ​& virtual-host-level cache root and cache policy? 
 + 
 +===== What About Other Page Caches===== 
 +Have other full page caches been disabled? ​You can only use one full page cache at a time, or there will be conflicts. 
 + 
 +===== Are there IP Restrictions?​ ===== 
 +If you have set **Enable LiteMage Cache Only for Listed IPs**, is your IP listed? 
 + 
 +===== Is Cache Management ​ Properly Configured? ===== 
 +For LiteMage to work correctly, you must have both **Configuration** and **Layouts** enabled under **System → Cache Management**. If you are using Magento Enterprise, you must also disable **Page Cache**. 
 + 
 +===== Have You Cleared the Cache? ===== 
 +Did you try flushing LiteMage Cache and Magento Cache Storage? ​Do so, and then reload the page a few times. 
 + 
 +===== Reach your license'​s cache object limit? ===== 
 +If you see the header ''​x-litespeed-cache-control:​ esi=on'',​ then the page is cachable but it has encountered a problem. one of the possible reason is LiteMage may have reached your license'​s cache object limit. You should check Magento Admin LiteMage stats for details. 
 + 
 +===== Did you turn off CDN cache? ===== 
 + 
 +CDN cache solutions may be conflicted with LiteMage, such as CloudFlare cache, Sucuri cache etc. Please make sure to turn off CDN cache when using LiteMage. 
 + 
 +{{:​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-cloudflare-incorrectcachesetting.png?​direct&​300}} 
 + 
 +Another example when the user using sucuri and turn on cache on sucuri, you always see **"​x-litespeed-cache:​ miss"​**:​ 
 + 
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-cdn-cache-problem1.png?​800 |}} 
 + 
 +If you visit backend directly with sucuri, LiteMage is running fine with **"​x-litespeed-cache:​ hit,​litemage"​**:​ 
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-cdn-cache-problem2.png?​500 |}} 
 + 
 +It's LiteMage'​s job to cache dynamic content, therefore, if you are going to use CloudFlare/​Sucuri cache, it must be set up to only cache //static// content. See [[https://​blog.litespeedtech.com/​2017/​11/​20/​magento-monday-litemage-cdns-and-tokens/​|this blog post]] for more details. 
 + 
 + 
 +===== Is There a Vary Cookie Issue? ===== 
 +If the cache vary cookie ''​_lscache_vary_toolbar''​ is set, then the page won't be cached for the first hit. This is expected bahavior. You should see  ''​X-Litespeed-Cache:​ miss''​ on the second hit, and ''​X-LiteSpeed-Cache:​ hit,​litemage''​ on the third hit. 
 + 
 +{{:​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-lscache-very-cookie1.png?​direct&​800}} 
 + 
 +==== Example ==== 
 +First hit: See Magento ''​frontend''​ and ''​frontend_cid''​ cookie with LSCache vary header 
 + 
 +{{:​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-right-cookie-header-with-lscache-very.png?​direct&​800}} 
 + 
 +Second hit: See Magento ''​frontend''​ and ''​frontend_cid''​ cookie with cache miss header 
 + 
 +{{:​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-right-cookie-header-with-lscache-very-miss.png?​direct&​800}} 
 + 
 +Third hit: See cache hit header 
 + 
 +{{:​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-right-cookie-header-with-lscache-very-miss-hit.png?​direct&​800}} 
 + 
 +===== Don't place "​RewriteRule (.*) - [E=Cache-Control:​no-cache]"​ in your .htaccess===== 
 + 
 +We have nowhere to tell you to place some white rule-based cache enabling/​disabling directive in .htacess. Normally if a user does follow our wiki, LiteMage should work out of the box after installation. However, we did find some cases the user placed the following rule to .htaccess, which break LiteMage and show the cache miss header all the time.  
 + 
 +As a reminder, please don't place any rewrite rule based cache directives especially the following to .htaccess, unless there is a wiki/KB instructing you to do.  
 + 
 +  RewriteRule (.*) - [E=Cache-Control:​no-cache]
  • Admin
  • Last modified: 2019/05/17 14:34
  • by Kacey Schroeder