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:litemage2:troubleshooting [2018/08/16 19:03]
Jackson Zhang [Is there any _lscache_very cookie problem causing new user always cache miss?]
litespeed_wiki:cache:litemage2:troubleshooting [2018/08/17 13:43]
Lisa Clarke [Diagnose the Issue]
Line 122: Line 122:
 To fix the problem, remove the ''/​home/​$USER/​lscache''​ folder completely and restart the web server. The cache root folder (normally ''/​home/​$USER/​lscache''​) will be created with correct ownership and permissions automatically during the restart. After restart, you should see the ''​x-litespeed-cache:​hit,​litemage''​ header. To fix the problem, remove the ''/​home/​$USER/​lscache''​ folder completely and restart the web server. The cache root folder (normally ''/​home/​$USER/​lscache''​) will be created with correct ownership and permissions automatically during the restart. After restart, you should see the ''​x-litespeed-cache:​hit,​litemage''​ header.
    
-===== Is there any _lscache_very cookie problem causing new user always cache miss? =====+===== LSCache Vary Cookie Problem Causing Cache Miss ===== 
 +==== Diagnose the Issue ==== 
 +With LiteMage2 enabled, open a brand new Chrome Incognito window to test the site and check the headers. You may see a cache vary cookie being set. This is a signal that the first visit from a new user sets a cache vary cookie but is not cached. On the second visit you might see cache miss, and a cache hit on the third. ​
  
-When LiteMage2 enabled, open a brand new chrome Incognito window to test the site and check the headers, you may see a cache very cookie being set, this is a signal that all news users first visit will be setting cache very cookie only and won't be cached. the second visit, ​ you might see cache miss, the third visit, see cache hit. If you do a few round tests, make sure each time close the incognito ​windows ​completely and start a new one to simulate brand new user instead of previous ​user.+If you do a few rounds of testing, make sure to close the incognito ​window ​completely and open a new window for each round. This is required ​to simulate ​brand new user.
  
 First visit: First visit:
Line 135: Line 137:
 {{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very3.png?​400 |}} {{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very3.png?​400 |}}
  
-Next, you can use another browser such as Firefox to simulate a different user and check the same homepage ​First ​visit, you will see cache very cookie being set.  The second visit, since the hope page has been cached, you will cache hit. If the page is not yet being cached, you will see cache miss then third visit cache hit. +Next, you can use another browser such as Firefox to simulate a different user and check the same pageOn the first visit, you will see the cache vary cookie being set. The second visit, since the page has already ​been cached, you will see a cache hit. (If the page has not yet been cached, you will see cache miss on the second ​visit and cache hit on the third.)
  
-{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very4.png?400 |}}+{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-vary4.png?400 |}}
  
-{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very5.png?400 |}}+{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-vary5.png?400 |}}
  
-There is a _lscache_very ​set, which causes all new users first visit will be always cache miss.  +There is an ''​_lscache_vary'' ​set, which causes all new users' ​first visit to always ​be a cache miss.  
-{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very2.png?500 |}}+{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-vary2.png?500 |}}
  
-For such case, if you run some benchmark test through ab or curl, the result will be invalid since the cache will never be hit. +For such case, if you run benchmark test through ​''​ab'' ​or ''​curl''​, the result will be invalidsince the cache will never be hit: ''​curl -I http://​yourdomain.com/''​
  
- curl -I http://​yourdomain.com/​ 
   HTTP/1.1 200 OK   HTTP/1.1 200 OK
   X-Powered-By:​ PHP/7.0.31   X-Powered-By:​ PHP/7.0.31
Line 174: Line 175:
   Connection: Keep-Alive   Connection: Keep-Alive
  
-How to fix it? You will need to locate the plugin/toolbar ​which causes such litemage ​cache very. +==== Fix the Problem ==== 
-In this case, we found an accessibility plugin on the homepage which causes such a problem. You may have other plugins such as a currency switcher plugin, a language plugin or a geolocation plugin etc.+To fix the problem, you will need to locate the plugin ​or toolbar ​that is causing the LiteMage ​cache vary.
  
-{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very6.png?400 |}}+In this example, we have found an accessibility plugin on the homepage which causes such a problem. You may have other plugins such as a currency switcher plugin, a language plugin or a geolocation plugin, which does the same. 
 + 
 +{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-vary6.png?400 |}}
  
 The accessibility plugin can be further expanded to the following if you click it: The accessibility plugin can be further expanded to the following if you click it:
  
-{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-very7.png?400 |}} +{{ :​litespeed_wiki:​cache:​litemage2:​litemage2-cache-vary7.png?400 |}}
- +
-You will need to disable such plugin if you want new user can hit cache for the first visit.  +
- +
-If you still want to use such plugin, it is not going to be too bad as you thought with such cache very cookie case. It only impacts a user's first visit (is actually only the first visit to one of the pages, not first visit to all pages, ). For the rest of the visits, all can be served from cache if those pages have been visited by other users and cached already.  +
- +
- +
  
 +You will need to disable this type of plugin if you want a new user to hit the cache on their first visit. ​
  
 +If you still want to use the plugin, it is not going to be as bad as you may think. This issue only impacts a user's first visit to one page (not the first visit to //each// page). For the rest of the user's visits, all pages can be served from cache, presuming they have already been cached by previous visitors. ​
 ===== How to setup cache warm up for Magento 2 using LiteMage 2 ===== ===== How to setup cache warm up for Magento 2 using LiteMage 2 =====
 Magento 2 warm up is not available yet. You could set public TTL to a longer time at this stage instead, for example 24 hrs, if applicable. Magento 2 warm up is not available yet. You could set public TTL to a longer time at this stage instead, for example 24 hrs, if applicable.
  • Admin
  • Last modified: 2020/07/08 19:33
  • by Lisa Clarke