cache query string
-
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:
-
because it needs to be this way , otherwise you will see the currency remains unchanged
like your default is USD , when you change to other like EUR or GBP or something , if it still get cache , you will still see USD instead of selected currency
so it sets a cookie to determine the currency and vary on the cache
by that saying , same URI , if cookie value is XXX , then it serve one cache , if cookie value is YYY then it serve another different cache , if cookie is ZZZ , then another cache.
thank you for writing back.
It looks like the crawler is only cache the default currency. Is there any way for the crawler to cache other currencies with those cookies?
crawler has a feature called cookie simulation for this
this setting is very new to me, can you point me what I should enter under this field?
cookie names are as follows:
wmc_current_currency
wmc_current_currency_old
and on the box to the right, I enter USD, EUR, GBP, one on each line?
wmc_current_currencyshould be enough , and yes , enter each currency by line , and also an empty value for default currencysorry, but how do I leave an empty value for default currency?
((leave a blank))
EUR
GBP
like this in three lines?

like this
thank you once again. I digged a little deeper and notice theres a thread created by another person on litespeed cache plugin.
Do I need to add these code? (https://ww.wp.xz.cn/support/topic/currency-converter-working-with-litespeed-cache-google-feed-etc/page/2/)
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$ = THB [NC] RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+thb RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = EUR [NC] RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+eur 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$ = MXN [NC] RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+mxn RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = NZD [NC] RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+nzdif it is working without it , then no need to add it
After adding those cookies, i notice that only the default currency is cached under chrom delveoper tools.
When I switch currency and press F5, theres no cache header.
Here’s a sample page:
https://www.mylovehoney.com/shop/plain-color-cable-knit-sleeveless-cardigan-vest/
May I ask where in htacess do I add this code to:
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$ = THB [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+thb]
RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = EUR [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+eur]
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$ = MXN [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+mxn]
RewriteCond %{HTTP_COOKIE} ^wmc_current_currency$ = NZD [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+nzd]thank you for the reply.
my site also uses query string so customers are quickly identified to use which currency when they land on the product page. it is how google shopping feed is set up. How do I get the crawler to crawl an url with query string
Just want to confirm if this is the right way to insert the code:
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] BEGIN LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
RewriteEngine on
CacheLookup on
RewriteRule .* - [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.php
RewriteCond %{QUERY_STRING} action=async_litespeed
RewriteRule .* - [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:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
CacheKeyModify -qs:attribute_pa_size
CacheKeyModify -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 start
ExpiresActive on
ExpiresByType application/pdf A3888000
ExpiresByType image/x-icon A3888000
ExpiresByType image/vnd.microsoft.icon A3888000
ExpiresByType image/svg+xml A3888000
ExpiresByType image/jpg A3888000
ExpiresByType image/jpeg A3888000
ExpiresByType image/png A3888000
ExpiresByType image/gif A3888000
ExpiresByType image/webp A3888000
ExpiresByType video/ogg A3888000
ExpiresByType audio/ogg A3888000
ExpiresByType video/mp4 A3888000
ExpiresByType video/webm A3888000
ExpiresByType text/css A3888000
ExpiresByType text/javascript A3888000
ExpiresByType application/javascript A3888000
ExpiresByType application/x-javascript A3888000
ExpiresByType application/x-font-ttf A3888000
ExpiresByType application/x-font-woff A3888000
ExpiresByType application/font-woff A3888000
ExpiresByType application/font-woff2 A3888000
ExpiresByType application/vnd.ms-fontobject A3888000
ExpiresByType font/ttf A3888000
ExpiresByType font/otf A3888000
ExpiresByType font/woff A3888000
ExpiresByType font/woff2 A3888000 marker BROWSER CACHE end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END NON_LSCACHEthe code broke my site and causes a 404 error
I guess its fine now, I move the code right after end of wordpress. I will see if cache is working after crawling is complete.
The topic ‘cache query string’ is closed to new replies.