Using geolocation/geotargeting plugins with WP Rocket

Geotargeting/geolocation features can conflict with page caching.

First, it's important to find out if the geolocation feature is using PHP or JavaScript/AJAX to run. 

You can contact the respective plugin support team to get this information. From that point on, please address the following instructions:

Geolocation using JavaScript/AJAX

If the geolocation is JavaScript/AJAX-based then it should work without any issues.

Geolocation using PHP

If the geolocation is using PHP then it won't work as expected.

This is because page cache eliminates all PHP/MySQL processes from a page and creates static HTML output instead.

Specifically, the PHP code will run only once (for the very first visitor) and the resulting code output that will get saved in the cached version of the site. This will result in unexpected site behavior for the rest of the upcoming visitors.

Workarounds for PHP-based geolocation

Compatible plugin

WP Rocket is currently automatically compatible with the GeoTargetingWP plugin, https://geotargetingwp.com/

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.