• Resolved raymond621

    (@raymond621)


    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/

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Support qtwrk

    (@qtwrk)

    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.

    Thread Starter raymond621

    (@raymond621)

    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?

    Plugin Support qtwrk

    (@qtwrk)

    crawler has a feature called cookie simulation for this

    Thread Starter raymond621

    (@raymond621)

    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?

    Plugin Support qtwrk

    (@qtwrk)

    wmc_current_currency should be enough , and yes , enter each currency by line , and also an empty value for default currency

    Thread Starter raymond621

    (@raymond621)

    sorry, but how do I leave an empty value for default currency?

    ((leave a blank))

    EUR

    GBP

    like this in three lines?

    Plugin Support qtwrk

    (@qtwrk)

    like this

    Thread Starter raymond621

    (@raymond621)

    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}+nzd

    Plugin Support qtwrk

    (@qtwrk)

    if it is working without it , then no need to add it

    Thread Starter raymond621

    (@raymond621)

    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/

    Thread Starter raymond621

    (@raymond621)

    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]
    Thread Starter raymond621

    (@raymond621)

    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

    http://www.abc.com/productA/?wmc-currency=AUD

    Thread Starter raymond621

    (@raymond621)

    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_LSCACHE
    Thread Starter raymond621

    (@raymond621)

    the code broke my site and causes a 404 error

    Thread Starter raymond621

    (@raymond621)

    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.

Viewing 15 replies - 1 through 15 (of 24 total)

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