-
Notifications
You must be signed in to change notification settings - Fork 223
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
Cache is cleared multiple times when switching theme #6276
Comments
@wp-media/php-team
will fire at the beginning of the function before the Could you please have a look at it? |
rocket_clean_domain is fired Moving back to needs grooming as well... |
How about checking if |
The Each callback makes sense individually, but there is some context where they will all fire one after the other. |
I've tried to take a look at it about the It's possible that I did something wrong with the |
If we add a bail-out within this function wp-rocket/inc/functions/files.php Line 805 in ea5ae60
such as if (1 === did_action( 'after_rocket_clean_domain' )) {
return;
} I can get down to 2 calls instead of 3. Not there yet, and I can't figure out where the 2 are from .. |
Yes, that's already an improvement |
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
The discussion was started here: #6263 (comment)
Now when switching the theme we are clearing the cache three times but we need to clear it once, this is because we add the callback
rocket_clean_domain
with different hooks as mentioned in the link above, will state them here too:First location:
wp-rocket/inc/common/purge.php
Line 16 in afef3b6
Second location:
wp-rocket/inc/common/purge.php
Line 8 in afef3b6
Third and main location:
wp-rocket/inc/common/purge.php
Line 6 in afef3b6
So we opened this issue to investigate the first two locations ad why they are firing with switch theme and in all cases we need the cache clear happens only once.
To Reproduce
Steps to reproduce the behavior:
wp-rocket/inc/functions/files.php
Line 806 in 7d56c41
Expected behavior
Cache clear should happen only once with switching theme.
Acceptance Criteria (for WP Media team use only)
The text was updated successfully, but these errors were encountered: