Wonderful Geo Page Cache
Most page caches store one copy of a page. That breaks every site that renders a page differently per country: a WooCommerce shop that shows prices including the VAT rate of the visitor’s country, or a site that sends first-time visitors from abroad to its English version. Cache such a site and ever
Most page caches store one copy of a page. That breaks every site that renders a page differently per country: a WooCommerce shop that shows prices including the VAT rate of the visitor’s country, or a site that sends first-time visitors from abroad to its English version. Cache such a site and every visitor sees the prices of whoever happened to fill the cache.
Wonderful Geo Page Cache keeps a separate copy per visitor country, looked up from the GeoLite2-Country database WooCommerce already maintains, and per value of the cookies you name. A visitor from Germany gets the copy rendered for Germany, a visitor from Austria the one for Austria — and bots and scanners, who hit the same pages over and over, cost about a millisecond instead of a full WordPress render.
What makes it different
- One copy per country — no country lookup in JavaScript, no flash of wrong prices, no “geolocate with page caching” URL parameters.
- Cookies that vary the page — name the cookies your site uses for a chosen country or language; each value gets its own copy.
- A country the visitor chose — when your site keeps a chosen delivery country in a cookie, name it as the country cookie: a visitor who picked Austria shares the copy of visitors from Austria instead of getting one of their own.
- Cookies that count only when set — a “first visit” marker your site only checks for gives one copy with and one without it, whatever its value.
- Cookies that may be replayed — a “first visit” cookie the site sets identically for everyone is stored with the page and sent again, so first visits are cached too. A response that sets any other cookie is never stored.
- Redirects are cached — a language or country redirect for first-time visitors is stored like a page.
- Safe against cache poisoning — requests whose client address is ambiguous (several forwarded addresses) are not cached, so a page rendered for one country cannot be stored for another.
- Pages stay cached until something changes — the security tokens (nonces) WordPress puts into a page are taken out when it is stored and computed afresh every time it is served, so a cached page never carries an expired token.