• Resolved waxaddict

    (@waxaddict)


    Hi, guys, I use Litespeed cache and all is great, except when I try to use a currency converter. I’ve tried so many but all have issues.

    If I do finally get one using geolocate that doesn’t stick on a random currency for everyone (i.e caching the currency changes), Google Merchant Center and Pinterest bots that get feeds from my site fail because the price isn’t properly being fed, likely due to geolocate price conversions and checking when someone visits the site.

    I imagine my only option is not using Geolcate, but having a manual switch where users can change the currency if they want – however, I need it not to be cached – has anyone found a plugin or method where this is possible?

    Just a switch or button where users can choose currency, but not have it cached with Litespeed, so it doesn’t stick or change for everyone.

    Thanks!

Viewing 15 replies - 16 through 30 (of 32 total)
  • Thread Starter waxaddict

    (@waxaddict)

    Ah ok, I’ll skip geo ip, saves me some headaches.

    The available values are USD, GBP, THB, EUR, AUD, CAD, MXN, NZD

    You really need all currencies?

    Do you use the crawler for cache warmup?
    Do you have Guestmode, webp replacement and Mobile View enabled?

    Thread Starter waxaddict

    (@waxaddict)

    Yeah why not? Any downside to having many? These are the top few countries that get clicked through from Google and have sales, figure I’d give visitors the choice.

    Please answer my last questions.

    Thread Starter waxaddict

    (@waxaddict)

    Do you use the crawler for cache warmup?

    I don’t think so, I just looked at the crawler section in LS and it says…

    The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin or hosting provider.

    Do you have Guestmode, webp replacement and Mobile View enabled?

    In the crawler section?

    I have

    Guest – WebP
    Guest

    I am guessing neither is working if the server hasn’t enabled the crawler? No idea about any of this or what it does tbh.

    Thread Starter waxaddict

    (@waxaddict)

    Just looking in that Crawler section (4) General Settings, and Crawler Cron is turned OFF, I haven’t tried setting it to ON.

    If you don’t use the crawler, you have 1 less problem with the caveat. The code that I am about to send you will solve your problem, but a URL must be requested up to 16x so that a page is cached for each currency. So without the crawler you have no benefit from the cache.

    I haven’t tried setting it to ON.

    If you are not allowed to use the crawler, it will not work. You should change the hosting provider that allows the crawler or search for alternative Cache Crawler that is especially made for LScache and can’t be blocked by hosting provider.

    Anyway, give me a few minutes to write the code.

    Sorry, not 16x, 18x.

    Thread Starter waxaddict

    (@waxaddict)

    So without the crawler you have no benefit from the cache.

    Does this mean the currency converter negatively affects the cache and page speed?

    > The code that I am about to send you will solve your problem, but a URL must be requested up to 16x so that a page is cached for each currency.?

    So less currencies would help with the above?

    No, not at all. The number of currencies affects the so-called Cache Varies. Varies are variants of a cache and if you have 8 currencies and you use additional webp replacements and the guest mode, that makes 2 x 8 + 2 = 18 different cache variants. Though I hope you know what a cache vary is?

    Thread Starter waxaddict

    (@waxaddict)

    Lol I don’t, I’m fairly clueless with anything other than the basic plug and play stuff.

    Thread Starter waxaddict

    (@waxaddict)

    Ok thanks, will have a read through in the morning, too tired for anything to register at the moment I think, but will check back in with you then, appreciate all your help so far.

    Invest the time in reading. It is worth it ..

    Add this code on top of your .htaccess outside of LiteSpeed markers and purge the cache.

    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
Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Currency converter working with Litespeed Cache, Google Feed etc’ is closed to new replies.