• Resolved cyrix2000

    (@cyrix2000)


    Hi,

    My website is using three currencies (USD, GBP and EUR) by using the Aelia currency switcher, which uses the Litespeed geolocation feature to display the correct currency to users (I know there may be inaccuracies due to VPNs etc) but that’s not a big issue.

    On top of that for all countries within the EU plus UK and Norway I’m charging (different) VAT rates (UK in GBP, EU and Norway in EUR). And to make it even more interesting under certain circumstances, user based, EU prices in EUR are shown without VAT. All these VAT changes are being calculated by another GEOIP and delivery address aware plugin.

    What I’m trying to work out is a cache vary strategy which allows me to build separate caches for each VAT/currency situation:

    Cache 1: ROW (USD, no VAT)

    Cache 2: UK (GBP, 20% VAT)

    Cache 3: NO (EUR, 25% VAT)

    Cache 4: CH & EU (EUR, no VAT)

    Cache 5: EU country 1 (EUR, EU country 1 VAT)

    Cache 6: EU Country 2 (EUR, EU country 2 VAT)

    Cache 32: EU Country 28 (EUR, EU country 28 VAT)

    What’s also an issue are third part website crawlers like Google who are getting confused about wrong currencies…

    So far the only option to make this work seems to be using the Aelia cache helper plugin which does an Ajax based reload of the page with correct prices, which is very resource hungry and quite slow.

    I’m also using Cloudflare CDN for static caching, but that shouldn’t have an impact here I guess.

    Any idea how to fix this “mess” with the means of Litespeed server?

    The page I need help with: [log in to see the link]

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

    (@qtwrk)

    your cloudflare page cache also cached x-litespeed-cache: miss header , suggest not to use cf cache with LSCWP , some options are not compatible.

    Thread Starter cyrix2000

    (@cyrix2000)

    Yes I am playing around with Cloudflare APO to find a solution but my ideal setup would be Litespeed cache based only.

    Plugin Support qtwrk

    (@qtwrk)

    disable APO , add

    <IfModule LiteSpeed>
    RewriteRule .* - [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]
    </IfModule>

    at top of your htaccess, this rule will create cache per country based on CF country code request header.

    Thread Starter cyrix2000

    (@cyrix2000)

    Thanks, I’ll give that a go.

    Thread Starter cyrix2000

    (@cyrix2000)

    The code seems to be working fine 🙂

    Now, to reduce the number of cache varies to be maintained, how would I generate a separate cache variation for each EU country, UK, Switzerland and Norway and a common one for all other countries?

    Plugin Support qtwrk

    (@qtwrk)

    that will be bit of more convoluted

    RewriteCond %{HTTP:CF-IPCountry} "ES" [NC]
    RewriteRule .* - [E=Cache-Control:vary=ES]
    RewriteCond %{HTTP:CF-IPCountry} "NL" [NC]
    RewriteRule .* - [E=Cache-Control:vary=NL]
    RewriteCond %{HTTP:CF-IPCountry} "UK" [NC]
    RewriteRule .* - [E=Cache-Control:vary=UK]

    something like this , you can keep adding the countries

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Multicurrency & multi-VAT page caching issues’ is closed to new replies.