Cache control by Cacholong


“Cache control by Cacholong” plugin automates purging of Nginx Pagespeed cache and Nginx FastCGI cache on your Nginx server(s). It is a backend plugin that is able to:

  • Purge Nginx Pagespeed cache and/or Nginx FastCGI cache.
  • Purging automatically, manually and with WordPress cronjobs.
  • Purge caches on one or more servers (See hosts.json section for more details).
  • Remove id tag from stylesheet link tags, in order to allow Nginx Pagespeed to combine stylesheets.
  • Allow purging of other cached items (see Settings > Cache control).
  • Inform user of purge status.
  • Support for single site and network sites
  • Support for WP-CLI

When will it purge?

This plugin will work with default and custom post types. It will purge on a save, regular update, quick edit update, slug change, delete and undelete. The user is informed with one or more messages.
There are a few caveats:

  • When a user is using the Gutenberg editor, purge messages will not be displayed.
  • When the user uses “Quick edit” and “Updates” the post, no messages will be displayed, because there’s no page refresh. Those messages will be shown on the next request.

It is possible to purge with WordPress cronjobs. Adjust the ‘Cronjob settings’ to perform a daily purge of caches.

You can also purge items manually. Go to the WordPress dashboard and navigate to:

  • Settings > Cache control > purge single item
  • Settings > Cache control > purge all caches
  • Admin Toolbar > purge all caches


  • File with hosts (JSON): File with information about one or more hosts for this WordPress installation. See hosts.json section for more details.
  • Pagespeed optimized CSS: Remove ID tag from all WordPress stylesheet link tags to improve Nginx Pagespeed caching.
  • Purge settings default post types: Select one or more options when purging a default post type. Possible to purge post url (default), home page, all connected WordPress categories or all caches.
  • Purge settings default custom type(s): Select one or more options when purging a custom post type. Possible to purge post url (default), home page, all connected WordPress categories or all caches.

Cronjob Settings

  • Cronjob purging: Enable or disable cronjob purging.
  • Cronjob time of each day: Enter HH:MM in 24 hour notation for cronjob time of day. Will fallback to 00:00 when wrong format is given.
  • Purge caches Select caches to purge on given cronjob time.


Hosts.json is a JSON file with information about one or more servers for this WordPress installation. Remember that this file must contain information about all servers, including this one.
Default path is: /uploads/cachelong-cache-control/hosts.json.

Here is an example of a hosts.json file:

        {"name": "server1", "ip": "", "pagespeed": true, "fastcgi": false},
        {"name": "server2", "ip": "", "pagespeed": false, "fastcgi": true},

Each line contains information about one server. Parameters:

name string Name of host, something to identify this server.
ip string IP address of server or full url. Format: scheme://host:port/path
pagespeed bool Server uses Nginx Pagespeed (true) or not (false)
fastcgi bool Server user Nginx FastCGI (true) or not (false)

When there is no hosts.json or the path is invalid, this plugin assumes the following:

        {"name": "localhost", "ip": "", "pagespeed": true, "fastcgi": true}

How does it work

“Cache control by Cacholong” empties partial or full cache for Nginx Pagespeed and FastCGI cache. WordPress HTTP API is used to make (post) request to
specific urls to trigger purges. Based on the http header responses this plugin determines if a purge is successful or not. The user is informed with messages, which are loaded after a purge and page refresh.

There are several settings to tweak purging, see Settings > Cache control.


Plugin will only log information when WP_DEBUG is true (can be set in wp-config.php).


  • “Cache control by Cacholong" settings panel.


Minimum Requirements

  • WordPress 4.3.1+
  • Nginx server with fastcgi_cache enabled

    Within the configuration of Nginx the variable $_SERVER[‘CC_NGINX_FASTCGI_CACHE_PATH’] must be provided containing the correct NGINX FASTCGI cache path. For documentation regarding Nginx setup please follow this link

Optional Requirements

  • hosts.json file. File contains information about hosts and which caches are active. See hosts.json section for more details. When not available, plugin assumes localhost with all caches active.

Automatic installation

  1. Log in to your WordPress dashboard and navigate to the plugins menu.
  2. Click “Add New”.
  3. Search for “Cache control by Cacholong”.
  4. Once you find our plugin, click “Install Now”.
  5. Activate the plugin
  6. Configure the plugin at Settings > Cache control

Manual installation

  1. Log in to your WordPress dashboard and navigate to the plugins menu.
  2. Click “Add New”.
  3. Click “Upload Plugin”.
  4. Locate zip file on your computer and click “Install Now”.
  5. Activate the plugin
  6. Configure the plugin at Settings > Cache control


Although our updates are thoroughly tested, make a backup of your website (files and database) before you install an update. Just to be sure!


Why doesn’t this plugin work?

This plugin has several requirements. Please check the minimum and optional requirements, before installing this plugin. Open a support topic if you
require additional help.

When i use “Quick edit” to edit a post, nothing is happening!

Although no message is displayed, the purge was activated! You can see the purge message when you refresh the page. This is a technical limitation.

Why do my cronjobs execute later then I expect?

WordPress cronjobs are not the same as real cronjobs. WordPress cronjobs will start if someone visits your website after (or on the) scheduled time. This might be later then expected.
It is possible to disable WordPress cronjobs and use a real cronjob that polls wp-cron.php on a regular base.

Why does my cronjob execute immediately?

If you enter a time of day that has already passed, the first cronjob is set to this time of day and is executed the first time the site is loaded (or wp-cron.php is called).

What should I do WordPress cronjobs are disabled?

WordPress cronjobs are disabled (‘DISABLE_WP_CRON’ = true). Please use a different type of cronjob to poll wp-cron.php on a regular base.
If purging of the cache fails through the cron mechanism make sure the hosts.json file is in place with the proper settings. See hosts.json section on the plugins page for more details.




Cache control by Cacholong はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。


“Cache control by Cacholong” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。


5.0.1 – 2020-09-30

  • Fixed – Removing id tag for pagespeed optimizing of css, caused issues with some backend plugins. Stripping id tags now only works on frontend.

5.0.0 – 2019-11-13

  • Added – Multisite support
  • Added – WP CLI support
  • Added – Factory reset
  • Added – Message when required $_SERVER[‘CC_NGINX_FASTCGI_CACHE_PATH’] is not set
  • Added – Message when all caches are disabled in hosts.json
  • Added – Plugin is tested for usage with WordPress 5.3.

See changelog.txt for all versions.