Title: cache query string
Last modified: September 14, 2024

---

# cache query string

 *  Resolved [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/)
 * Hi Support
 * I am using this plugin called CURCY that allows my shop to switch currency using
   javascript. The product’s URL remains the same regardless which currency I use.
   Under Chrome inspection, I can see the product is showing a “Hit” status for 
   page cache, when I switch to another currency, it is showing as “missing”?
 * The URL is the same, so why is the latter not cached?
 * Here is a sample product:
 * [https://www.marsnvenus.com/shop/sample-product-a-copy/](https://www.marsnvenus.com/shop/sample-product-a-copy/)

Viewing 9 replies - 16 through 24 (of 24 total)

[←](https://wordpress.org/support/topic/cache-query-string-2/?output_format=md) 
[1](https://wordpress.org/support/topic/cache-query-string-2/?output_format=md) 
2

 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18015907)
 * it turns out that none of the pages with query string is being cached even after
   completing the crawling.
 * /?wmc-currency=AUD
 * /?wmc-currency=USD
 * /?wmc-currency=CAD
 * /?wmc-currency=GBP
 * /?wmc-currency=NZD
 * I thought after adding the cookie simulation, it would be crawled and cached.
   I ahve google shopping feeds set up with query string so customers from different
   countries will be directed to the right product page, displaying the correct 
   currency. Is this the normal behavior and how do I make sure the appended query
   string is cache when it warms up from the crawling?
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18015955)
 * And I don’t think the codes provided earlier works. Even after crawling the entire
   site, when I checked on the product link without the query string, it is not 
   being cached. Would you like to take a look at my homepage or product pages? 
   Only the default currency USD is being cached.
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18016446)
 * Why does it cost 404 error when I access to alll pages with this code. Only the
   homepage works fine. I already added the code at the very top of htacess.
 *     ```wp-block-code
       <IfModule Litespeed>RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = USD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+usd]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = GBP [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+gbp]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = AUD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+aud]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = CAD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+cad]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = NZD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+nzd]</IfModule># BEGIN LSCACHE## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##<IfModule LiteSpeed>RewriteEngine onCacheLookup onRewriteRule .* - [E=Cache-Control:no-autoflush]RewriteRule litespeed/debug/.*\.log$ - [F,L]RewriteRule \.litespeed_conf\.dat - [F,L]### marker ASYNC start ###RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.phpRewriteCond %{QUERY_STRING} action=async_litespeedRewriteRule .* - [E=noabort:1]### marker ASYNC end ###### marker CACHE RESOURCE start ###RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]### marker CACHE RESOURCE end ###### marker LOGIN COOKIE start ###RewriteRule .? - [E="Cache-Vary:,wp-postpass_2cdc91481948393ac7cf30292d6e21d2,wmc_current_currency,wmc_current_currency_old,wmc_ip_info"]### marker LOGIN COOKIE end ###### marker DROPQS start ###CacheKeyModify -qs:fbclidCacheKeyModify -qs:gclidCacheKeyModify -qs:utm*CacheKeyModify -qs:_gaCacheKeyModify -qs:attribute_pa_sizeCacheKeyModify -qs:attribute_pa_color### marker DROPQS end ###</IfModule>## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ### END LSCACHE# BEGIN NON_LSCACHE## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##### marker BROWSER CACHE start ###<IfModule mod_expires.c>ExpiresActive onExpiresByType application/pdf A3888000ExpiresByType image/x-icon A3888000ExpiresByType image/vnd.microsoft.icon A3888000ExpiresByType image/svg+xml A3888000ExpiresByType image/jpg A3888000ExpiresByType image/jpeg A3888000ExpiresByType image/png A3888000ExpiresByType image/gif A3888000ExpiresByType image/webp A3888000ExpiresByType video/ogg A3888000ExpiresByType audio/ogg A3888000ExpiresByType video/mp4 A3888000ExpiresByType video/webm A3888000ExpiresByType text/css A3888000ExpiresByType text/javascript A3888000ExpiresByType application/javascript A3888000ExpiresByType application/x-javascript A3888000ExpiresByType application/x-font-ttf A3888000ExpiresByType application/x-font-woff A3888000ExpiresByType application/font-woff A3888000ExpiresByType application/font-woff2 A3888000ExpiresByType application/vnd.ms-fontobject A3888000ExpiresByType font/ttf A3888000ExpiresByType font/otf A3888000ExpiresByType font/woff A3888000ExpiresByType font/woff2 A3888000</IfModule>### marker BROWSER CACHE end ##### LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ### END NON_LSCACHE# BEGIN WordPress# The directives (lines) between "BEGIN WordPress" and "END WordPress" are# dynamically generated, and should only be modified via WordPress filters.# Any changes to the directives between these markers will be overwritten.<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]RewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPress
       ```
   
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017107)
 * this code itself won’t alter any permalink , you can try flush the permalink 
   again , see how it goes
 * and also , if your currency works without this , then you don’t really need to
   put it in.
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017152)
 * But adding the code just like how I did definitely broke the site and returned
   a 404 error for all pages except the homepage. I cant seem to get this to work
   and the plugin provider asked me to contact lightspeed cache for support.
 * I also added cookie simulation for wmc-currency with value AUD.
 * When I go to the product page ([https://www.mylovehoney.com/shop/sunflower-print-enjoy-the-little-things-onesie-short-sleeve-denim-tiered-bloomers-with-headband/](https://www.mylovehoney.com/shop/sunflower-print-enjoy-the-little-things-onesie-short-sleeve-denim-tiered-bloomers-with-headband/)?
   wmc-currency=AUD), its a cache miss but the cookies are there. Press F5, cache
   hits. Exit the browser and open the above link, it becomes a cache miss again.
   What seems to be wrong?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017211)
 * I don’t think this rewrite rule will break page rewrite
 * please create a ticket by mail to `support at litespeedtech.com` , we will investigate
   further.
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017264)
 * Do I email support to here?
 * [info@litespeedtech.com](https://wordpress.org/support/topic/cache-query-string-2/page/2/info@litespeedtech.com?output_format=md)
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017268)
 * I another site from the same hosting company but uses shared hosting, and it 
   works without errors with the code.
 * Even If I copied the entire code from that site to my vps server from the same
   hosting company, it causes 404 error.
 *  Thread Starter [raymond621](https://wordpress.org/support/users/raymond621/)
 * (@raymond621)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017281)
 * I altered the code slightly by removing <IfModule Litespeed> and </IfModule> 
   and move the code all the way to the bottom after #END WordPress
 * Right now there’s no more 404 errors but how do I know if the code is actually
   rewriting anything base on the specified rules?
 *     ```wp-block-code
       BEGIN LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!RewriteEngine onCacheLookup onRewriteRule .* - [E=Cache-Control:no-autoflush]RewriteRule litespeed/debug/.*.log$ - [F,L]RewriteRule .litespeed_conf.dat - [F,L] marker ASYNC startRewriteCond %{REQUEST_URI} /wp-admin/admin-ajax.phpRewriteCond %{QUERY_STRING} action=async_litespeedRewriteRule .* - [E=noabort:1] marker ASYNC end marker CACHE RESOURCE startRewriteRule wp-content/./[^/](responsive|css|js|dynamic|loader|fonts).php - [E=cache-control:max-age=3600] marker CACHE RESOURCE end marker LOGIN COOKIE startRewriteRule .? - [E="Cache-Vary:,wp-postpass_2cdc91481948393ac7cf30292d6e21d2,wmc_current_currency,wmc_current_currency_old,wmc_ip_info"] marker LOGIN COOKIE end marker DROPQS startCacheKeyModify -qs:fbclidCacheKeyModify -qs:gclidCacheKeyModify -qs:utm*CacheKeyModify -qs:_gaCacheKeyModify -qs:attribute_pa_sizeCacheKeyModify -qs:attribute_pa_color marker DROPQS end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END LSCACHE BEGIN NON_LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! marker BROWSER CACHE startExpiresActive onExpiresByType application/pdf A3888000ExpiresByType image/x-icon A3888000ExpiresByType image/vnd.microsoft.icon A3888000ExpiresByType image/svg+xml A3888000ExpiresByType image/jpg A3888000ExpiresByType image/jpeg A3888000ExpiresByType image/png A3888000ExpiresByType image/gif A3888000ExpiresByType image/webp A3888000ExpiresByType video/ogg A3888000ExpiresByType audio/ogg A3888000ExpiresByType video/mp4 A3888000ExpiresByType video/webm A3888000ExpiresByType text/css A3888000ExpiresByType text/javascript A3888000ExpiresByType application/javascript A3888000ExpiresByType application/x-javascript A3888000ExpiresByType application/x-font-ttf A3888000ExpiresByType application/x-font-woff A3888000ExpiresByType application/font-woff A3888000ExpiresByType application/font-woff2 A3888000ExpiresByType application/vnd.ms-fontobject A3888000ExpiresByType font/ttf A3888000ExpiresByType font/otf A3888000ExpiresByType font/woff A3888000ExpiresByType font/woff2 A3888000 marker BROWSER CACHE end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END NON_LSCACHE BEGIN WordPress The directives (lines) between "BEGIN WordPress" and "END WordPress" are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten.RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] END WordPress LITESPEED WP CACHE FOR WMC CURRENCY CUSTOM STARTRewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = USD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+usd]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = GBP [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+gbp]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = AUD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+aud]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = CAD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+cad]RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = NZD [NC]RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+nzd] LITESPEED WP CACHE FOR WMC CURRENCY CUSTOM END
       ```
   

Viewing 9 replies - 16 through 24 (of 24 total)

[←](https://wordpress.org/support/topic/cache-query-string-2/?output_format=md) 
[1](https://wordpress.org/support/topic/cache-query-string-2/?output_format=md) 
2

The topic ‘cache query string’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 24 replies
 * 3 participants
 * Last reply from: [raymond621](https://wordpress.org/support/users/raymond621/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/cache-query-string-2/page/2/#post-18017281)
 * Status: resolved