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 Both sides next revision
litespeed_wiki:cache:drop_query_string [2018/07/26 13:14]
Jackson Zhang [How to drop Query String when using LSCache?]
litespeed_wiki:cache:drop_query_string [2018/07/26 13:29]
Jackson Zhang
Line 1: Line 1:
 ====== How to drop Query Strings when using LSCache? ====== ====== How to drop Query Strings when using LSCache? ======
  
-In an effort to make some requests more cache friendly, LiteSpeed Enterprise v5.2.3+ added a feature to drop certain query string parameters.+For each query string that is attached to a URL, a separate copy of the page is cached. In many cases this is intentional,​ desired behavior. However, when you have "​junk"​ query string parameters that don't change the content of the page, it's redundant to cache separate copies. ​In an effort to make some requests more cache friendly, LiteSpeed Enterprise v5.2.3+ added a feature to drop certain query string parameters. ​
  
-===== Why is this Helpful? ===== +There are two ways to modify/​drop ​query strings: one is to use Apache like configuration directive ''​CacheKeyModify ...''​and the other one is to use the rewrite ruleswhich is more flexible and preferred way.
-For each query string that is attached ​to a URL, a separate copy of the page is cachedIn many cases this is intentional,​ desired behaviorHoweverwhen you have "​junk"​ query string parameters that don't change ​the content of the pageit's redundant to cache separate copies.+
  
-===== How does it Work? =====+===== Method 1: Using Apache like configuration directive ''​CacheKeyModify ...'' ​=====
 The Apache-style configuration directive is ''​CacheKeyModify ...'',​ and its purpose is to modify the query string attached to a URL. The Apache-style configuration directive is ''​CacheKeyModify ...'',​ and its purpose is to modify the query string attached to a URL.
  
Line 32: Line 31:
   * ''​CacheKeyModify clear''​ discards all previous configurations.   * ''​CacheKeyModify clear''​ discards all previous configurations.
  
-===== How to Enable the LSWS Drop Query String Feature on cPanel ​=====+==== How to Enable the LSWS Drop Query String Feature on cPanel ​using ''​CacheKeyModify ...''? ​====
  
 As long as the LSWS version is 5.2.3 or above, this feature is enabled by default and does not need any further configuration in the LSWS WebAdmin GUI or in Apache configurations. You may wish to override the default settings at the server level, virtual-host level or even the ''​.htaccess''​ level. As long as the LSWS version is 5.2.3 or above, this feature is enabled by default and does not need any further configuration in the LSWS WebAdmin GUI or in Apache configurations. You may wish to override the default settings at the server level, virtual-host level or even the ''​.htaccess''​ level.
Line 77: Line 76:
 * The feature to add rule sets may not be fully implemented on v5.2.3, but //will// be fully implemented in the next release. * The feature to add rule sets may not be fully implemented on v5.2.3, but //will// be fully implemented in the next release.
  
-===== How to Modify LSCache Query Strings with Rewrite Rules ===== +===== Method 2: How to Modify LSCache Query Strings with Rewrite Rules ===== 
-We can also use rewrite rules. This method supports multiple commands combinedand gives you more flexibility.+Other than ''​CacheKeyModify ...'', ​We can also use rewrite rules to modify/drop query stings. This method supports multiple commands combined and gives you more flexibility.
  
 For this example, we remove ''​utm_source''​ with an exact match, and ''​utm_medium''​ with a prefix match. For this example, we remove ''​utm_source''​ with an exact match, and ''​utm_medium''​ with a prefix match.
  • Admin
  • Last modified: 2021/11/11 20:54
  • by Lisa Clarke