Title: Country Caching For WP Super Cache
Author: wrigs1
Published: <strong>2015-03-18</strong>
Last modified: 2021-03-24

---

Szukaj wtyczek

Wtyczka **nie została przetestowana z trzema ostatnimi głównymi wydaniami WordPressa**.
Może nie być już utrzymywana lub obsługiwana, co może skutkować problemem ze zgodnością
z nowszymi wersjami WordPressa.

![](https://s.w.org/plugins/geopattern-icon/country-caching-extension-for-wp-super-
cache.svg)

# Country Caching For WP Super Cache

 Autor: [wrigs1](https://profiles.wordpress.org/wrigs1/)

[Pobierz](https://downloads.wordpress.org/plugin/country-caching-extension-for-wp-super-cache.zip)

 * [Szczegóły](https://pl.wordpress.org/plugins/country-caching-extension-for-wp-super-cache/#description)
 * [Recenzje](https://pl.wordpress.org/plugins/country-caching-extension-for-wp-super-cache/#reviews)
 *  [Instalacja](https://pl.wordpress.org/plugins/country-caching-extension-for-wp-super-cache/#installation)
 * [Rozwój](https://pl.wordpress.org/plugins/country-caching-extension-for-wp-super-cache/#developers)

 [Wsparcie](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/)

## Opis

DUE TO PERSONAL CIRCUMSTANCES I AM NO LONGER ABLE TO DEVELOP OR SUPPORT THIS PLUGIN.
IF YOU ARE INTERESTED IN ADOPTING THIS PLUGIN SEE https://developer.wordpress.org/
plugins/wordpress-org/take-over-an-existing-plugin/

**Bonus** also makes Cookie Notice work correctly with WPSC (whether using country/
EU geolocation or not).

Allows WP Super Cache to display the correct page/widget content for a visitor’s
country when you are using geo-location; solves problems like these reported on 
[WordPress.Org](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-with-geo-targeting)
and [StackOverflow](http://stackoverflow.com/questions/21308405/geolocation-in-wordpress).

A similar extension is available [for Comet Cache](https://wordpress.org/plugins/country-caching-extension/).

This plugin builds an extension script that enables Super Cache to create separate
snapshots (cache) for each page based on country location.

Separate snapshots can be restricted to specific countries. E.g. if you are based
in the US but customize some content for Canadian or Mexican visitors, you can restrict
separate caching to CA & MX visitors; and all other visitors will see the same cached(„
US”) content.

You can also specify a single snapshot for a group of countries e.g. all European
Union countries.

It works on both normal WordPress and Multisite (see FAQ) installations.

More info in [the user guide](http://wptest.means.us.com/geolocation-and-wp-super-cache-caching-by-page-visitor-country-instead-of-just-page/)

**Identification of visitor country for caching**

Via Cloudflare or Maxmind (when the plugin is first enabled it uploads GeoLite2 
data created by MaxMind, available from http://www.maxmind.com ). Cloudflare works
with any PHP version, but Maxmind Geolite2 requires PHP 5.4 or later. _It is also
possible to connect a different GeoLocation sytem of your choice (see documentation)._

If you use Cloudflare and have „switched on” their GeoLocation option ( see [Cloudflare’s instructions](https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-CloudFlare-IP-Geolocation-do-))
then it will be used to identify visitor country. If not, then the Maxmind Country
Database will be used.

**Updating** (If not using Cloudflare for country) The installed Maxmind Country/
IP data file will lose accuracy over time. To automate a monthly update of this 
file, install and enable the [Category Country Aware (CCA) plugin](https://wordpress.org/plugins/category-country-aware/)(
Country Caching and the Cataegory Country Aware (CCA) plugins use the same Maxmind
data file in the same folder and the CCA plugin includes code for its update). The
CCA plugin has many other features and functionality you may find useful. Alternatively
you can manually update (FAQ below).

### ADVICE

I don’t recommend you use ANY Caching plugin UNLESS you know how to use an FTP program(
e.g. Filezilla). Caching plugins can cause „white screen” problems for some users.
WP Super Cache is no different; when I checked the first page of its support forum
it included 4 [posts like this](https://wordpress.org/support/topic/site-broken-after-activate-wp-super-cache).
Sometimes the only solution is to manually delete files using FTP or OS command 
line. When deactivated/deleted via Dashboard->Plugins; the Country Caching plugin
deletes its files, but in „white screen” situations you may have to resort to „manual”
deletion – see FAQ for instructions.

### License

This program is free software licensed under the terms of the [GNU General Public License version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
as published by the Free Software Foundation.

In particular please note the following:

This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.

## Zrzuty ekranu

[⌊Simple set up. Dashboard->WPSC Country Caching⌉⌊Simple set up. Dashboard->WPSC
Country Caching⌉[

Simple set up. Dashboard->WPSC Country Caching

## Instalacja

(Obvously you must have WP Supercache installed and activated. If you wish, you 
can switch off caching in it settings until you have finished your Country Cachching
set-up.)

Install Country Caching plugin in normal way. Then go to „Dashboard->WPSC Country
Caching”. Check the „_Enable WPSC Country Caching add-on_” box, and save settings.

## Najczęściej zadawane pytania

### Where can I find support/additional documentation

Support questions should be posted on WordPress.Org
 Additional documentation [is provided here](http://wptest.means.us.com/geolocation-and-wp-super-cache-caching-by-page-visitor-country-instead-of-just-page/)

### How do I know its working

See [these checks](http://wptest.means.us.com/geolocation-and-wp-super-cache-caching-by-page-visitor-country-instead-of-just-page/#works).

### How do I keep the Maxmind country/IP range data up to date

Automatically: install the [Category Country Aware plugin](https://wordpress.org/plugins/category-country-aware/)
from WordPress.Org and enable its settings; it will update your Maxmind data every„
month”.

Manually: monthly/whatever; download „GeoLite2-Country.tar.gz” from [Maxmind](https://dev.maxmind.com/geoip/geoip2/geolite2/)
and extract the file „GeoLite2-Country.mmdb” and upload it to your servers „/wp-
content/cca_maxmind_data/” directory.

### Will it work on Multisites

Yes, it will be the same for all blogs (you can’t have it on for Blog A, and off
for Blog B).

On MultiSites, the WPSC Country Caching settings menu will be visible on the Network
Admin Dashboard (only).

### How do I stop/remove Country Caching

Temporarilly: uncheck „Enable Country Caching” in the plugin’s settings.

Permanently: deactivate then delete plugin via Dashboard in usual way. Then go to
WP Super Cache settings and clear cache.

If you deleted the plugin’s directory instead of uninstalling via Dashboard::

 1. Use your Server’s Control Panel, or log into your site via FTP; e.g. with CoreFTP
    or FileZilla and (if necessary).
 2. Delete this directory and its content: /wp-content/ccwpsc_plugins/ (or any alternative
    add-on directory you defined yourself by editing wp-cache-config.php)
 3. Delete this file: „cca_wpsc_geoip_plugin.php” from „/wp-content/wp-super-cache/
    plugins/”
 4. Edit /wp-content/wp-cache-config.php and change _„$wp\_cache\_plugins\_dir = '/
    somepath/wp-content/ccwpsc\_plugins’;”_ to _„$wp\_cache\_plugins\_dir = WPCACHEHOME.'
    plugins’;”_

## Recenzje

![](https://secure.gravatar.com/avatar/e08ceab9b6071708055ab2885565d028bf4738c648b1668103e3495b95e9af91?
s=60&d=retro&r=g)

### 󠀁[No longer working](https://wordpress.org/support/topic/no-longer-working-115/)󠁿

 [chillpilllike](https://profiles.wordpress.org/chillpilllike/) 2020-04-15

The plugin is no longer maintained and doesnt work with the latest version of super
cache

![](https://secure.gravatar.com/avatar/3d6e968a9ad338c66f480610794474334601aeebc001cb2b3735fe0e8d268f59?
s=60&d=retro&r=g)

### 󠀁[Very good](https://wordpress.org/support/topic/very-good-3439/)󠁿

 [Julian Vu](https://profiles.wordpress.org/julianvu/) 2018-10-19

This is very useful for me

![](https://secure.gravatar.com/avatar/43053d1fd1f0ca2740e134eac666eb2e59e848da1bb198b4aa438387578f67c4?
s=60&d=retro&r=g)

### 󠀁[WooCommerce Multi Currency and WP Super Cache](https://wordpress.org/support/topic/woocommerce-multi-currency-and-wp-super-cache/)󠁿

 [kimvt1991](https://profiles.wordpress.org/kimvt1991/) 2018-08-02

A great solution for people who use WP Super Cache and WooCommerce Multi Currency
with Auto select currency feature. Highly recommended.

![](https://secure.gravatar.com/avatar/4dede0aa905fa16443c12f95ba7977e7257ad963423a61b79e48ce3871729144?
s=60&d=retro&r=g)

### 󠀁[Great plugin, problem solver for GDPR](https://wordpress.org/support/topic/great-plugin-problem-solver-for-gdpr/)󠁿

 [alexac1970](https://profiles.wordpress.org/alexac1970/) 2018-06-19

Works fine, it's the only valid solution I've found to accomplish with EU cookie
law without disturbing the rest of the world, if using a cache plugin. I've configured
two groups, EU users and non EU users, and both pages are cached separately at WP
super cache and served accordingly.

 [ Przeczytaj 4 recenzje ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/)

## Kontrybutorzy i deweloperzy

„Country Caching For WP Super Cache” jest oprogramowaniem open source. Poniższe 
osoby miały wkład w rozwój wtyczki.

Zaangażowani

 *   [ wrigs1 ](https://profiles.wordpress.org/wrigs1/)

[Przetłumacz wtyczkę “Country Caching For WP Super Cache” na swój język.](https://translate.wordpress.org/projects/wp-plugins/country-caching-extension-for-wp-super-cache)

### Interesuje cię rozwój wtyczki?

[Przeglądaj kod](https://plugins.trac.wordpress.org/browser/country-caching-extension-for-wp-super-cache/),
sprawdź [repozytorium SVN](https://plugins.svn.wordpress.org/country-caching-extension-for-wp-super-cache/)
lub czytaj [dziennik rozwoju](https://plugins.trac.wordpress.org/log/country-caching-extension-for-wp-super-cache/)
przez [RSS](https://plugins.trac.wordpress.org/log/country-caching-extension-for-wp-super-cache/?limit=100&mode=stop_on_copy&format=rss).

## Rejestr zmian

#### 0.8.0

 * Fix for Cookie Notice to make it work correctly with WPSC (whether or not you
   are using geolocation or CCA to restrict CN to EU visitors)

#### 0.7.0

 * Major improvements – to benefit from these changes you should re-save your CC
   settings. See [information on major changes/improvements](http://wptest.means.us.com/ccwpsc-changes/).

#### 0.6.0

 * Altered code to handle WordPress function validate_file treating file paths on
   IIS servers like „D:\site\path/” as invalid. Not tested on IIS (volunteers?).
 * Increased the number of server variables checked to identify visitor location
 * Additional diagnostics added to Support tab

## Meta

 *  Wersja **0.8.0**
 *  Ostatnia aktualizacja **6 lat temu**
 *  Włączone instalacje **200+**
 *  Wersja WordPressa ** 3.3 lub nowszej **
 *  Testowano do **4.9.33**
 *  Język
 * [English (US)](https://wordpress.org/plugins/country-caching-extension-for-wp-super-cache/)
 * Tagi
 * [caching](https://pl.wordpress.org/plugins/tags/caching/)[country](https://pl.wordpress.org/plugins/tags/country/)
   [GeoIP](https://pl.wordpress.org/plugins/tags/geoip/)[super cache](https://pl.wordpress.org/plugins/tags/super-cache/)
   [WP Super Cache](https://pl.wordpress.org/plugins/tags/wp-super-cache/)
 *  [Widok zaawansowany](https://pl.wordpress.org/plugins/country-caching-extension-for-wp-super-cache/advanced/)

## Oceny

 4.3 na 5 gwiazdek.

 *  [  3 recenzje 5-gwiazdkowe     ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/?filter=5)
 *  [  0 recenzji 4-gwiazdkowych     ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/?filter=4)
 *  [  0 recenzji 3-gwiazdkowych     ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/?filter=3)
 *  [  1 recenzja 2-gwiazdkowa     ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/?filter=2)
 *  [  0 recenzji 1-gwiazdkowych     ](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/?filter=1)

[Twoja opinia](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/#new-post)

[Zobacz wszystkierecenzje.](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/reviews/)

## Zaangażowani

 *   [ wrigs1 ](https://profiles.wordpress.org/wrigs1/)

## Wsparcie

Masz coś do dodania? Potrzebujesz pomocy?

 [Zobacz forum wsparcia](https://wordpress.org/support/plugin/country-caching-extension-for-wp-super-cache/)

## Złóż datek

Czy chcesz wesprzeć rozwój wtyczki?

 [ Wspomóż wtyczkę ](http://means.us.com/)