We use WP Rocket and when we post an announcement, it doesn’t show until we clear WP Rocket’s cache. Is there a method or hook we could use to clear the cache when an announcement is activated or disabled?
I haven’t used WP Rocket. But every caching plugin must have some kind of hook to clear the cache.
There are various caching plugins out there. So it wouldn’t be possible to automatically clear the cache for one specific plugin.
Since announcements are just like posts, may be you can check with WP rocket team to see if it is possible to clear cache when posts of type “announcer” is published.
If you can find the hook to clear the cache, then you can use it with WordPress’s on publish post hook and call the wp rocket function to clear the cache.
Also, since announcements are something which are not often changed, I think it would be better to manually clear the cache in WP rocket.
Hope this helps.
Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter