New Cleavr WordPress Cache Clear Plugin!

We’ve created a new WordPress plugin that lets you more easily clear Cache - either by a click of a button in the plugin settings or you can set to automatically clear cache when new content is added.

Well, maybe saying we “created” is a little misleading… We forked the very handy NGINX Cache plugin to make it work better with Cleavr as well as to get around an issue with the NGINX Cache plugin which is that it doesn’t work when assigning a site to a different server user. The plugin unfortunately only works for the default NGINX user that it’s running on, which in Cleavr’s case is the ‘cleavr’ user.

With our new forked version, you can simply supply the clear cache hook that’s provided in the NGINX Cached section of Cleavr.

Would you like to try out the beta version of the plugin?

Installation Instructions

Download and install plugin

Download beta plugin here

Add plugin to WordPress

In your WordPress admin section, go to the plugins section and click Add New.

Next, click on Upload Plugin and then upload the wordpress-plugin.zip file that you downloaded previously.

Activate the plugin and then click on settings for the new Cleavr plugin.

Configure plugin settings

Add in the Clear Cache Trigger Hook that is found in Cleavr > Server > Site > FastCGI.

Note - you will need FastCGI to be enabled for your site for this plugin to work.

If you’d like the cache to be cleared every time content changes, enable the option and cache will be cleared automatically.

Clicking the ‘Clear Cache’ button will clear the cache for your site.

Help us make it better

Let us know if you run across any issues with the plugin by commenting below.

Want some additional features for the plugin? We’d love to hear them! Add a comment below and let us know your thoughts.

2 Likes

The Cleavr Clear Cache plugin is now live and available in the WordPress plugin library!

Thanks for those who helped us test the plugin and please do let us know if you have any suggestions on how we might improve it!

Awesome! Thanks so much for forking and improving this plugin for Cleavr users.

One thing that would be awesome if it could be improved, but not sure it’s possible, is that if you enable auto cache clearing on content changes (which I find it pretty essential in many cases) then when saving a simple single page instead of it being nearly instant, now takes several seconds (because I’m guessing the entire cache is being cleared at the same time?).

Thanks again for making this!

Hi,

FastCGI cache works different than a Cache plugin in WordPress. I don’t think there is a way remove only a few “pages”. Or better from WordPress there is no way to address the specific files.

It would be great to keep the other cached files anyway. Because a bot or visitor need to access a page twice before the cached file is served.

You’re welcome!

It’s probably taking longer now due to the post request via the clear cache hook vs using the cache path where the operation would be quicker. We’ll see if there is a way to background or look for some other methods to make that part less noticeable

I’m also curious to see if we can target the cache for where the content is being changed, we’ll have to research that. :sunglasses:

Curious how you gonna do that. Check the document structure like /0/3a/ or /8/33/
This is kinda different from the slugs or ID’s in WordPress :wink:

We should be able to modify headers to better target specific pages. We haven’t researched it a ton but I’ve seen some solutions claim the ability. :slightly_smiling_face:

Hi,
it’s time for the first plugin update :slight_smile:
Since Cleavr 2.0 the placeholder for the URL field on the settings page needs an update.
If you do so please add this attribute to the field as well: autocomplete="off"

Feature suggestion: Redirect to the settings page after plugin activation.

2 Likes

Yup! Thanks for the reminder. I’ve added the other asks to the to-do list as well. :slight_smile:

you’re welcome :slight_smile:

1 Like

I have this fatal error, any direction on how to solve it?

Hi,
I’m the one who is running the plugin on more than 100 websites :slight_smile:
Never had this fatal error. Does it happen on a fresh install as well?

Wow, 100 websites!

I found that I need to copy the hock URL from cleavr into the plugin, so that the following error won’t show up.

For other user reference:
The link is under Sites > Cache

Another topic:

What cache plugins do you use beside the default server cache?

Are you using the right plugin. The setting screen for the Cleavr clear cache plugin exists in the Tools > Cleavr

so that the following error won’t show up.

What error? You get this error in your email

What cache plugins do you use beside the default server cache?

If you use PHP for caching you should be able to use any plugin. For example WP Super Cache in Easy mode.

@amiedema he is right this error happens for me if I click “Clear cache” while the hook URL isn’t entered yet. Some validation would help here :slight_smile:

The problem

Uncaught Error: Object of class WP_Error could not be converted to string in /home/user/mysite.nl/current/wp-content/plugins/cleavr-clear-cache/cleavr.php:101

is located here ($result is a WP error object)

error_log( 'Result Code: ' . $result );

I’m not sure if this is same error like Mike reported, but it’s a small bug that should be fixed