How to Use with WP Rocket

WP Rocket’s full-page cache can serve a page geolocated for one visitor to everyone. This guide keeps CBR PRO’s country detection working with WP Rocket. Background: How CBR PRO Detects the Customer’s Country.

INFO
Since CBR PRO 4.3.6, the country cookie is registered with WP Rocket automatically and requests involving the country selector are excluded from caching. On current versions the manual steps below are usually only needed if you still see wrong countries on cached pages, or you run an older CBR PRO version.

First: Enable Caching-Aware Geolocation

WooCommerce → Settings → General → Default customer location → Geolocate (with page caching support)

This handles the visitors who have no country cookie yet (first-time guests): the country is resolved in the browser after the cached page loads, so a cached page isn’t wrong for them. The steps below handle visitors who have a country cookie.

Never Cache Cookies

Add country to WP Rocket → Advanced Rules → Never Cache Cookies. Visitors who selected a country then always get an uncached page with the correct catalog.

IMPORTANT
Never Cache Cookies disables caching entirely for every visitor who holds the country cookie, which costs performance if many visitors use the country selector. The faster alternative is WP Rocket’s cache-per-cookie mechanism (dynamic cookie caching, available via WP Rocket’s helper plugin for dynamic cookies): it keeps a separate cache variant per country value instead of skipping the cache. Use Never Cache Cookies for simplicity, dynamic cookie caching for performance.

Never Cache URL(s)

If country-specific pages still show wrong content, exclude them in WP Rocket → Advanced Rules → Never Cache URL(s). Cover every page whose content depends on the country — shop, products, categories, and search results — using WP Rocket’s wildcard patterns (adjust to your permalink structure):

/shop/(.*)
/product/(.*)
/product-category/(.*)
/?s=(.*)

Clear the Cache

After changing any of these settings, clear WP Rocket’s cache (WP Rocket → Dashboard → Clear and preload cache) so previously cached country-specific pages are removed.

Next Steps