Hi,
I have a webshop which is selling internationally, in different currencies (USD, EUR and GBP) and with different VAT rates (EU country based, Norway and UK). I'm using Litespeed Webserver (incl. Wordpress plugin) together with quic.cloud as CDN. I have setup different caches for each VAT/currency combination in the webshop via rewrite rules in the .htaccess file (see below).
My problem is, that customers accessing the website without being logged in, don't see the correct currency/VAT combination (they are seeing a cached version of the site, but not from the cache "appropriate" for them).
I'm wondering what I may have misconfigured in Litespeed Cache/quic.cloud/htaccess, which is causing this problem.
Here the geolocation cache related .htaccess rules (geoloaction is activated on the Litespeed webserver):
<IfModule LiteSpeed>
RewriteEngine on
RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEOIP_COUNTRY_CODE}]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LU
RewriteRule .* - [E=Cache-Control:vary=LU_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} MT
RewriteRule .* - [E=Cache-Control:vary=MT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CY
RewriteRule .* - [E=Cache-Control:vary=CY_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} DE
RewriteRule .* - [E=Cache-Control:vary=DE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} RO
RewriteRule .* - [E=Cache-Control:vary=RO_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} AT
RewriteRule .* - [E=Cache-Control:vary=AT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} BG
RewriteRule .* - [E=Cache-Control:vary=BG_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} EE
RewriteRule .* - [E=Cache-Control:vary=EE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} FR
RewriteRule .* - [E=Cache-Control:vary=FR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SK
RewriteRule .* - [E=Cache-Control:vary=SK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} BE
RewriteRule .* - [E=Cache-Control:vary=BE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CZ
RewriteRule .* - [E=Cache-Control:vary=CZ_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LV
RewriteRule .* - [E=Cache-Control:vary=LV_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LT
RewriteRule .* - [E=Cache-Control:vary=LT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} NL
RewriteRule .* - [E=Cache-Control:vary=NL_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ES
RewriteRule .* - [E=Cache-Control:vary=ES_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IT
RewriteRule .* - [E=Cache-Control:vary=IT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SI
RewriteRule .* - [E=Cache-Control:vary=SI_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IE
RewriteRule .* - [E=Cache-Control:vary=IE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} PL
RewriteRule .* - [E=Cache-Control:vary=PL_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} PT
RewriteRule .* - [E=Cache-Control:vary=PT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} FI
RewriteRule .* - [E=Cache-Control:vary=FI_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} GR
RewriteRule .* - [E=Cache-Control:vary=GR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} HR
RewriteRule .* - [E=Cache-Control:vary=HR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} DK
RewriteRule .* - [E=Cache-Control:vary=DK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SE
RewriteRule .* - [E=Cache-Control:vary=SE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} NO
RewriteRule .* - [E=Cache-Control:vary=NO_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} HU
RewriteRule .* - [E=Cache-Control:vary=HU_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} UK
RewriteRule .* - [E=Cache-Control:vary=UK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CH
RewriteRule .* - [E=Cache-Control:vary=CH_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IM
RewriteRule .* - [E=Cache-Control:vary=IM_COUNTRY]
</IfModule>
I have a webshop which is selling internationally, in different currencies (USD, EUR and GBP) and with different VAT rates (EU country based, Norway and UK). I'm using Litespeed Webserver (incl. Wordpress plugin) together with quic.cloud as CDN. I have setup different caches for each VAT/currency combination in the webshop via rewrite rules in the .htaccess file (see below).
My problem is, that customers accessing the website without being logged in, don't see the correct currency/VAT combination (they are seeing a cached version of the site, but not from the cache "appropriate" for them).
I'm wondering what I may have misconfigured in Litespeed Cache/quic.cloud/htaccess, which is causing this problem.
Here the geolocation cache related .htaccess rules (geoloaction is activated on the Litespeed webserver):
<IfModule LiteSpeed>
RewriteEngine on
RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEOIP_COUNTRY_CODE}]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LU
RewriteRule .* - [E=Cache-Control:vary=LU_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} MT
RewriteRule .* - [E=Cache-Control:vary=MT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CY
RewriteRule .* - [E=Cache-Control:vary=CY_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} DE
RewriteRule .* - [E=Cache-Control:vary=DE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} RO
RewriteRule .* - [E=Cache-Control:vary=RO_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} AT
RewriteRule .* - [E=Cache-Control:vary=AT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} BG
RewriteRule .* - [E=Cache-Control:vary=BG_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} EE
RewriteRule .* - [E=Cache-Control:vary=EE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} FR
RewriteRule .* - [E=Cache-Control:vary=FR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SK
RewriteRule .* - [E=Cache-Control:vary=SK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} BE
RewriteRule .* - [E=Cache-Control:vary=BE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CZ
RewriteRule .* - [E=Cache-Control:vary=CZ_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LV
RewriteRule .* - [E=Cache-Control:vary=LV_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} LT
RewriteRule .* - [E=Cache-Control:vary=LT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} NL
RewriteRule .* - [E=Cache-Control:vary=NL_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ES
RewriteRule .* - [E=Cache-Control:vary=ES_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IT
RewriteRule .* - [E=Cache-Control:vary=IT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SI
RewriteRule .* - [E=Cache-Control:vary=SI_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IE
RewriteRule .* - [E=Cache-Control:vary=IE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} PL
RewriteRule .* - [E=Cache-Control:vary=PL_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} PT
RewriteRule .* - [E=Cache-Control:vary=PT_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} FI
RewriteRule .* - [E=Cache-Control:vary=FI_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} GR
RewriteRule .* - [E=Cache-Control:vary=GR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} HR
RewriteRule .* - [E=Cache-Control:vary=HR_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} DK
RewriteRule .* - [E=Cache-Control:vary=DK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} SE
RewriteRule .* - [E=Cache-Control:vary=SE_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} NO
RewriteRule .* - [E=Cache-Control:vary=NO_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} HU
RewriteRule .* - [E=Cache-Control:vary=HU_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} UK
RewriteRule .* - [E=Cache-Control:vary=UK_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} CH
RewriteRule .* - [E=Cache-Control:vary=CH_COUNTRY]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IM
RewriteRule .* - [E=Cache-Control:vary=IM_COUNTRY]
</IfModule>