“Cache control by Cacholong” is a cache control plugin for one or more Nginx servers.
“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:
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:
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:
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 the
one with this plugin. Default path is: wp-content/uploads/cacholong-cache-control/hosts.json.
Here is an example of a hosts.json file:
{"servers": [ {"name": "server1", "ip": "127.0.0.1", "pagespeed": true, "fastcgi": false}, {"name": "server2", "ip": "127.0.0.2", "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:
{"servers": [ {"name": "localhost", "ip": "127.0.0.1", "pagespeed": true, "fastcgi": true} ] }
“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.
There are several commands available for the commandline with wp-cli. Commands generate text output which can be suppressed with –quiet. When an error occurs, text will always be displayed.
Exit codes are 0 (no errors) or 1 (generic error).
Purge command with all arguments:
wp cacholong_cc purge [--cache=<cache>] [--ips=<ips>]
Purge Nginx FastCGI:
wp cacholong_cc purge --cache=fastcgi
Purge Nginx Pagespeed:
wp cacholong_cc purge --cache=pagespeed
Purge all caches:
wp cacholong_cc purge --cache=all wp cacholong_cc purge
Purge Nginx Pagespeed cache for ip address 127.0.0.1 and 127.0.0.2:
wp cacholong_cc purge --cache=pagespeed --ips=127.0.0.1,127.0.0.2
Purge all caches for ip address 127.0.0.1 and 127.0.0.2:
wp cacholong_cc purge --ips=127.0.0.1,127.0.0.2
Factory reset options for given site_id or current blog if no site_id is given:
wp cacholong_cc factory_reset [--site_id=site_id]
Plugin will log basic purge information when WP_DEBUG is true (can be set in wp-config.php). Logs information in file wp-content/cacholong-cache-control.log.
Plugin will log wp_remote_request details when CACHOLONG_CACHE_DEBUG_HTTP_API_REQUEST is true (can be set in wp-config.php). Logs information in file wp-content/cacholong-cache-control.log.
Although updates are thoroughly tested, make a backup of your website (files and database) before you install an update.
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.
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.
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.
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).
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 cronjob cache purging fails make sure the hosts.json file is in place with the proper settings. See hosts.json section on the plugins page for more details.
See changelog.txt for all versions.