Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

(NGINX User Cache) Purge from within WordPress (Simple Plugin for WP)

Luke Thompson shared this idea 2 years ago
Open Discussion

G'day,

After making the switch to the NGINX + Apache + PHP-FPM stack with most clients running WordPress, it's become clear that having an NGINX Cache Purge one-click link within WordPress is a fundamental tool that many would benefit from immensely!

This would reduce time spent on mundane work, as the staff can remain within WP and click-and-carry-on, rather than new-tab > WHM > cP SSO > NGINX Purge. Just a week into the new stack, we have had this request from a bunch of clients. There's feedback online as well.

https://forums.cpanel.net/threads/cpanel-nginx-and-wordpress.704621/ (whole thread)
https://forums.cpanel.net/threads/whm-96-nginx-cache.690045/ (towards the bottom)
etc.

Developing this and keeping it supported would presumably be quite simple and low-maintenance given it's ready-to-go in the UAPI - https://api.docs.cpanel.net/openapi/cpanel/operation/clear_cache/ - and an admin bar "Clear NGINX Cache" link via this hook it seems https://developer.wordpress.org/reference/hooks/admin_bar_menu/ - is this easily achieved?

With this NGINX implementation now 1.5 years mature, it seems a great time to add this in! :-)

Many thanks.

Replies (6)

photo
3

yes agree - without a plugin that you can purge from within WP we will be disableing NGINX.

photo
3

100% Agree with Luke's comments as it becomes frustrating for me and my team when developing in WordPress.

photo
2

Agree this is a must. We don't run cPanel's NGINX implementation for this very reason.

photo
2

Agreed, no cache plugin for WordPress makes our customers confused.

photo
2

Hey follks!

Thanks for the feedback. We don't currently provide integrations that exist within WordPress. This is not to say we won't. For that reason, I've transitioned this to open discussion in order to gain further feedback.


Thanks!

photo
4

We've now published a WordPress Plugin that provides a one-click Purge NGINX Cache button in the admin top bar:

https://github.com/LEOPARD-host/TNC-WP-Toolbox

It needs a cPanel API Token to be set in a static file above public_html for it to work. Hopefully it helps others. Thanks!

photo
1

Very interesting! Does this implementation provide an auto-cache-refresh when posts/pages are published are must it always be manually invoked?

photo
2

Not as yet, though that's not to say it won't be done! I've raised an issue/request on the repo now.

The latest versions don't need a static file, rather they use Settings > TNC Toolbox for the config.

Also, we've had it approved by WordPress.org now! https://wordpress.org/plugins/tnc-toolbox/

photo
1

Awesome plugin! Well done for creating it, to meet this need, going to try this plugin out. I've been struggling with the woo-commerce site when I update a product title or make it draft, areas like the product category page still show incorrect title or keeping showing the product. Be great if down the line it had intelligent caching woo-commerce support to.

photo
Leave a Comment
 
Attach a file