Cache Refresher
A WordPress plugin to refresh your cache periodically or on-demand
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/joppuyo/cache-refresher/releases/download/v0.0.3/cache-refresher.zipReadme
Cache Refresher
This is a WordPress plugin that allows you to refresh your cache periodically or on-demand.
And by refreshing, I mean it will ping your page using a HTTP GET request.
It's mostly useful when used in conjunction with microcaching or for warming your cache after a deployment.
The plugin works in the background using a queue so it will refresh one page at the time and thus will hopefully avoid overloading your server.
On demand
This allows you to refresh every page on your site. There are two methods you can use
HTTP request
You can refresh every page on your site by sending a GET request to an URL. You can find this URL under Options and Cache Refresher. It looks something like this:
https://example.com/wp-json/cache-refresher/v1/refresh-all?token=gnjvb5th13ken07nmwov9gqnt
You can ping it using your CI pipeline or something. I may add a button to the UI to do this also.
WP CLI
Run the following command
wp cache-refresher refresh-all
Scheduled refreshing
This plugin will refresh all pages on your site every day at 00:01 in the site time zone. I will maybe add some option to disable or customize this in the future.
Refresh on save
When you save or delete a post, the plugin will ping the permalink of that post. I will maybe add some option to disable or customize this in the future.
⚠️ Refresh on save doesn't use a queue. Instead it's done immediately after the save using an asynchronous request
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v0.0.3 | Jan 27, 2022 | cache-refresher.zip | 7 |
| v0.0.2 | Jan 21, 2022 | cache-refresher.zip | 7 |
Active-site estimate ≈10 comes from the median of recent superseded releases. Method.