Creating custom ESI blocks in php websites




Wordpress LScache Plugin: Creating custom ESI blocks in php websites

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, I have a WordPress site, with a custom php code in header.php to show an alert if the user IP is from a Country different as the geolocation of this page. For example, is you access the page https://some.domain.com/SPAIN/ from an IP of US, it will show a message inviting the visitor to change to the US version of this page https://some.domain.com/US/ Now, Im forced to disable CACHE for these pages cause it show the cached version of that page including the alert for the first visitor, not the current one. How can I exclude this portion of code from header.php from being cached, using the ESI technlogy ? Im using LiteSpeed with LS+CACHE thank you! Hi, Please check this wiki Best regards, Thank you, but for some reason it just print my_esi_block Hi Are you using v3 ? Best regards, ouch, Im using the latest one: Versi?n 2.9.9.2 where can I get a higher version than public in WordPress plugin repository ? found thank you Hi, Everything is cool now ? Best regards, It is AWESOME thank you



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference