Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a filter to disable Homepage cache clearing #7187

Open
alfonso100 opened this issue Dec 13, 2024 · 0 comments
Open

Add a filter to disable Homepage cache clearing #7187

alfonso100 opened this issue Dec 13, 2024 · 0 comments

Comments

@alfonso100
Copy link
Contributor

alfonso100 commented Dec 13, 2024

Is your feature request related to a problem? Please describe.
Quite often, we get support tickets where the customers want to disable all forms of cache clearing.
We do have a public doc and helper plugin for this:
https://docs.wp-rocket.me/article/137-disable-automatic-cache-clearing

However, the homepage cache cleanups can't be stopped.

The code of the helper plugin has been gaining complexity through the years, as from time to time we discover new ways where the cache is cleared: https://github.com/wp-media/wp-rocket-helpers/blob/master/cache/wp-rocket-no-cache-auto-purge/wp-rocket-no-cache-auto-purge.php

Describe the solution you'd like
Add a filter to prevent the homepage cache from clearing.

A customer, Emiel (from the HS ticket below) suggested the following edit to our purge.php code:

	// Never forget to purge homepage and their pagination.
	if(apply_filters( 'rocket_clean_home_after_clean_post', true, $post_id ) === true ) {
		rocket_clean_home( $lang );
	}

Describe alternatives you've considered
@joejoe04 suggested adding a more global filter to completely turn off all forms of cache cleanups in a consistent way. Including everything.

Additional context
Slack convo: https://wp-media.slack.com/archives/C43T1AYMQ/p1733320312253029
related ticket: https://secure.helpscout.net/conversation/2764323421/523592?viewId=1213662

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

No branches or pull requests

1 participant