Linux 软件免费装
Banner图

Wonderful Geo Page Cache

开发者 wonderfulplugins
更新时间 2026年11月4日 23:30
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv3
版权网址: 版权信息

标签

cache woocommerce geolocation page cache vat

下载

1.0.5 1.0.6 1.0.7 1.0.8

详情介绍:

https://www.youtube.com/watch?v=WEbKAD3ByMg 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 How it works

安装:

  1. Install and activate the plugin.
  2. Add define( 'WP_CACHE', true ); to wp-config.php.
  3. Go to Settings → Geo Page Cache, name the cookies and URL parameters your site varies on, and enable the cache.
  4. Check a page with your browser's developer tools: the response header X-Wonderful-Geo-Page-Cache says MISS on the first request and HIT on the next one.

屏幕截图:

  • Toolbar menu: cached pages, last prewarm, switch the cache off, empty it.

常见问题:

Where does the country come from?

From a GeoLite2-Country database on your server. If WooCommerce geolocation is enabled, its database is used automatically; otherwise enter the path of any MaxMind DB file. Nothing is sent to an external service.

My server sits behind a proxy.

If the web server already puts the client address into REMOTE_ADDR (mod_remoteip, as in the official WordPress Docker image), keep REMOTE_ADDR — mod_remoteip removes the forwarded header it has read. Otherwise choose the header that carries the client address (for example HTTP_X_FORWARDED_FOR). If the configured source is missing on a request, that request is not cached rather than filed under an unknown country.

How does prewarming render a page for another country?

The prewarmer requests the page from the site itself with a header signed by a key derived from the salts in wp-config.php, which only the site knows and which is never written to a file. The drop-in accepts that header only with a valid signature and then treats the request as coming from an address in the wanted country (taken from the GeoLite2 database), so WordPress renders exactly what a visitor from there would get. It sends at most two requests a second.

Where are cached pages stored?

In wp-content/uploads/wonderful-geo-page-cache/: the cached pages, the configuration the drop-in reads and the prewarm state, all as plain data files, never as code. An .htaccess file closes the folder to web requests on Apache and LiteSpeed. On nginx, add a rule such as location ^~ /wp-content/uploads/wonderful-geo-page-cache/ { deny all; }.

Does it work with another cache plugin?

No. Only one plugin can own advanced-cache.php; the plugin never overwrites another plugin's drop-in and tells you when one is installed.

更新日志:

1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 0.9.5 0.9.4 0.9.3 0.9.2 0.9.1 0.9.0