Differences
This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
litespeed_wiki:cache:lscwp:handle-cookie-vary [2018/10/08 15:01] Eric Leu created |
litespeed_wiki:cache:lscwp:handle-cookie-vary [2018/10/08 15:02] Eric Leu |
||
---|---|---|---|
Line 3: | Line 3: | ||
Example: assume you have a woocommerce site and bring "woocommerce_products_per_page" cookie which should vary from user to user, and you should not serve everyone with the same cache file. | Example: assume you have a woocommerce site and bring "woocommerce_products_per_page" cookie which should vary from user to user, and you should not serve everyone with the same cache file. | ||
- | and there are two ways to accomplish this: a javascript-based plugin, and cache vary rewrite rules. | + | There are two ways to accomplish this: |
+ | ====javascript-based plugin==== | ||
- | 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: | + | 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. |
+ | |||
+ | ====cache vary rewrite rules==== | ||
+ | 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: | ||
<IfModule LiteSpeed> | <IfModule LiteSpeed> |