I need to cache users in different countries to serve specific VAT rates.
I have tried a few options but they led to performance issues.
What I think will work best (this is a live site so I don’t have the option to rebuild) is to use the Transform Rules to add a query string to the url based on location. That way I can then cache each country individually and serve them the correct VAT amounts from my website backend.
However, my site is based on WooCommerce so I need to exclude “wp-admin” from the query string else the backend of the website falls over.
I tried the following expression but it still keeps adding the query to the backend url (oddly it only shows in the url bar for the admin pages and not for the front end). I also need to exclude the cart pages etc but I have added “companyname-cart” to each endpoint so I if I can exclude ‘wp-admin’ I’ll just use the same method for that.
(not http.request.uri.path contains "wp-admin") or (ip.geoip.country eq "GB" and not http.request.uri contains "companyname-cart")
I added a dynamic query string of ip.geoip.country
as the rewrite.
I really need to get this to work but it’s not performing as I’d expect