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
Last revision Both sides next revision
litespeed_wiki:cache:litemage:troubleshooting:handle-cookie-vary [2017/05/04 20:39]
Michael Alegre
litespeed_wiki:cache:litemage:troubleshooting:handle-cookie-vary [2018/10/08 14:50]
Eric Leu
Line 1: Line 1:
 ===== How to Configure Cookie Cache Vary ===== ===== How to Configure Cookie Cache Vary =====
-At the bottom of the store, there is a yellow tab that reads ''​To accept cookies from this site, please click the Allow button below.'' ​By default, the page retrieved from the cache always includes the yellow bar, whether or not the user has clicked ​''​Allow.''​+At the bottom of the store, there is a yellow tab that reads **To accept cookies from this site, please click the Allow button below**. By default, the page retrieved from the cache always includes the yellow bar, whether or not the user has clicked ​**Allow**.
  
 This behavior should vary from user to user, and there are two ways to accomplish this: a javascript-based plugin, and cache vary rewrite rules. This behavior should vary from user to user, and there are two ways to accomplish this: a javascript-based plugin, and cache vary rewrite rules.
  
-The more efficient option is a javascript-based solution. A javascript plugin would only need to store one copy of the page and would build the display based on the existence of the cookie. If a rewrite rule-based answer is preferred, the site can be configured to vary on the cookie by adding the following ​rewrite ​rule to your sites .htaccess file:+The more efficient option is a javascript-based solution. A javascript plugin would only need to store one copy of the page and would build the display based on the existence of the cookie. If a rewrite rule-based answer is preferred, the site can be configured to vary on the cookie by adding the following rule to your site'​s ​.htaccess file:
  
  
-  RewriteRule .* - [E=cache-vary:​user_allowed_save_cookie]+  RewriteRule .* - [E=Cache-Vary:​user_allowed_save_cookie]
   ​   ​
-When a customer clicks ​''​Allow''​, the cookie ''​user_allowed_save_cookie=%7B%221%22%3A1%7D;''​ will be created. Using the rewrite rule above, the cache will vary on that cookie. This means the cache will store two copies: one that shows the yellow bar at the bottom, and one that does not.+When a customer clicks ​**Allow**, the cookie ''​user_allowed_save_cookie=%7B%221%22%3A1%7D;''​ will be created. Using the rewrite rule above, the cache will vary on that cookie. This means the cache will store two copies: one that shows the yellow bar at the bottom, and one that does not.
  
  • Admin
  • Last modified: 2018/10/08 14:55
  • by Eric Leu