Skip to content

Add clear cache on updates functionality#5

Open
filipmanzi wants to merge 4 commits intocloudpanel-io:masterfrom
filipmanzi:feature/clear-cache-on-update
Open

Add clear cache on updates functionality#5
filipmanzi wants to merge 4 commits intocloudpanel-io:masterfrom
filipmanzi:feature/clear-cache-on-update

Conversation

@filipmanzi
Copy link

@filipmanzi filipmanzi commented Feb 10, 2024

Added functionality to let CloudPanel Plugin clear host cache automatically when a theme, plugin or WordPress core update has finished. Especially helpful for website owners using theme builders such as Elementor.

Handling feature request in issue #4

Edit 14 feb: I refactored some of the code to follow the existing code style of the plugin (Object oriented programming).

@BenJamesAndo
Copy link

Thanks for adding this. I've started using this update and it's been great.
To take it even further you could add an option to clear cache on page or post update. I've definitely encountered issues when a page gets updated but the changes are reflected until the cache is cleared.

@filipmanzi
Copy link
Author

Hey @BenJamesAndo! Awesome that you liked it, and thanks for the feature request. I'll try to implement such functionality sometime, if no one else gets to it before me.

@filipmanzi
Copy link
Author

Hey!

The codebase has been updated to include a new functionality within the settings: the option to clear cache following updates to posts and pages. Additionally, modifications have been made to the existing feature that clears the cache upon WordPress Core updates. These adjustments now accommodate third-party management systems, including ManageWP.

In order to make this work, I've shifted some logic outside of the admin class. My recommendation to repo maintainers is to restructure some of the classes and maybe add a class for functions that do not have to do with admin functions. Then it would be possible to move my contributed code into a class in order to keep up with the OOP principles in main branch.

Let me know what you think :)

@BenJamesAndo
Copy link

Hey, thanks for also adding in clear on post or page update. Is there an easy way to verify it's working? I checked the X-Cache-Age and it keeps increasing instead of resetting to 0 after I update a page or post. Is it designed to clear the cache even when using Elementor or updating a custom post type?

@cosborn-eits
Copy link

Hi, did we ever get official confirmation of this working?

@aayris
Copy link

aayris commented Nov 28, 2025

Hey guys,

recently i was facing issue on my WordPress websites, hosted on CloudPanel + Varnish. Unfortunately, cloudpanel WordPress plugin was unable to purge cache on post update, even on new post, sitemap was not updating. I have made a PR with changes implemented. lets see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants