How to configure LiteSpeed cache to work with GeotargetingWP?

Litespeed generates page cache on your site, meaning that in order to use our plugin you should enable AJAX mode to avoid getting cached results in your browser.

If you are targeting just countries, there is an option to configure Litespeed and instruct it to create a different cached page based on countries. So for example for a page called /sample-page Litespeed will have multiple versions such as /sample-page.html-US and /sample-page.html-FR

Follow these steps to configure litespeed:

  1. Add the following rules to your .htacess file
                
                    GeoIPEnable On
                    RewriteEngine on
                    CacheLookup on
                    RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEO_COUNTRY}]
                
            
    This will instruct LiteSpeed to vary the cache files based on $_SERVER['GEO_COUNTRY_CODE'] variable . The debug data should should a value for that.

Check out our WordPress geolocation solutions
to find out everything you can do!

Start your free trial