Country rules are evaluated by WordPress when a request reaches it. A full-page cache or CDN can return saved HTML before WordPress runs. That can show one country’s content to another country or keep showing a page after its rule changes. Treat caching as part of every country-rule launch.
Object cache versus page cache
An object cache such as Redis keeps reusable WordPress data between requests. WordPress still renders each response, so WPLocation can evaluate the current visitor’s country. It may reduce repeated database work, but it does not cache the finished page or guarantee a particular load time. The WPLocation store uses an isolated Redis object cache for this reason.
Checkout, purchase confirmation and customer account pages must remain outside any shared full-page cache. The same is true of pages with country-specific rules unless the cache is proven to vary by the right visitor signal. For Easy Digital Downloads carts, account sessions and purchase links, include the platform’s documented page and cookie exclusions if you add a separate HTML cache.
Choose a safe cache strategy
- Identify every cache layer: hosting page cache, WordPress cache plugin, reverse proxy and CDN. Browser cache is a separate layer.
- Exclude targeted URLs from shared full-page cache unless the layer demonstrably varies entries by a trusted country signal. Do not assume a “geolocation compatible” marketing label proves the current rule works.
- Test at the public edge: check an allowed and denied location on the exact URL, including the second request after a cache entry exists.
- Purge after changes: rule edits, data-source changes and plugin updates can leave old HTML in cache.
Free asks WordPress not to cache targeted output and purges WP Super Cache when its API is available. Those steps cannot control every host or CDN. WPLocation does not currently provide a universal AJAX rendering mode or country-specific cache-key integration. Configure your own cache stack deliberately.
A practical test matrix
| Request | Expected check |
|---|---|
| Allowed country, first visit | Targeted content appears. |
| Denied country, after first visit | The response is still restricted; it is not the cached allowed page. |
| Allowed country, after denied visit | Content remains available; a blocked response has not contaminated the cache. |
| Unknown country | Actively restricted content stays hidden. |
For Pro stores, repeat the checks for catalog, direct product URL, cart and checkout. A cached catalog card is only one part of the flow. See WooCommerce testing.
If a page looks wrong
Bypass and purge each cache layer one at a time. Check the active rule, the local database and the address seen by the origin using Diagnostics. A VPN may also be affected by a previous browser or edge cache entry. Never rely on country rules to secure private files or confidential content.
Contact WPLocation with your software versions and the result you expected. Keep keys and customer data private.
