Wordpress LScache Plugin: Disable Cache for Geo Targeting
Last Updated on: Wed, 15 Apr 2026 00:00:02 With the arrival of GDPR I need to enable Geo-targeting to ensure my GDPR notice gets shown only to EU users. The problem is that Geo-targeting does not work with LS cache. The solution that I am implementing relies on the geoiplookup.io API. Thanks. The page I need help with: https://json.geoiplookup.io/ Are you using JS to detect Geo and show notice or using someway else? My plugin uses a PHP function to query the remote json.geoiplookup.io Is that a AJAX call to query and show? If not, the query could slow down the site loading time. Also, as after the url is cached, it will not hit PHP again, so other visitors will see the same content always. Would suggest you using JS AJAX call to determine if need to show the notice or not. Or use vary created by geolocation on rewrite rule level to separate the cache copy: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:common:geoip-support I have found a GDPR plugin that works perfectly with LiteSpeed cache and Geo-targeting EU users: Ninja GDPR Compliance 2018
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference