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
Cloudflare purged several times on post update #6043
Comments
Not sure what will we be able to improve here, as per our past discussions. Let's revisit this part of the code and try to do the following: Prerequisites: WP Rocket enabled, CF plugin enabled, APO activated for the domain Acceptance Criteria:
|
We could remove the hook on If we remove our hooks entirely, it will allow to have only one request, but it might not cover all URLs to clean, as the CF plugin is not clearing as much as us. And as discussed earlier, their hooks are not implemented correctly so we can't add additional data to them. |
@Tabrisrp I'd split this ticket into two then:
What do you think? |
So, in this PR we'll only remove the |
I would not have high expectations for the PR on their side, there is already an issue about it that was not solved since at least a couple years. |
@Tabrisrp @piotrbak While doing exploratory for this issue, I found that For future reference, the reason those functions run twice is because clean_post_cache() run
wp_debug_backtrace_summary: 'require(\'wp-blog-header.php\'), wp, WP->main, WP->parse_request, do_action_ref_array(\'parse_request\'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, clean_post_cache'
13:12:45 clean_post_cache fired
===== rocket_clean_files() =====
array (
0 => 'https://wprocketest.test/hello-world',
1 => 'https://wprocketest.test/blog',
2 => 'https://wprocketest.test/author/vasilis/',
)
===== rocket_clean_post() =====
array (
0 => 'https://wprocketest.test/hello-world',
1 => 'https://wprocketest.test/blog',
2 => 'https://wprocketest.test/author/vasilis/',
)
clean_post_cache run
wp_debug_backtrace_summary: 'edit_post, wp_update_post, wp_insert_post, clean_post_cache'
13:12:45 clean_post_cache fired
===== rocket_clean_files() =====
array (
0 => 'https://wprocketest.test/hello-world',
1 => 'https://wprocketest.test/blog',
2 => 'https://wprocketest.test/post-53',
3 => 'https://wprocketest.test/post-2',
4 => 'https://wprocketest.test/gallery-layout',
5 => 'https://wprocketest.test/author/vasilis/',
)
===== rocket_clean_post() =====
array (
0 => 'https://wprocketest.test/hello-world',
1 => 'https://wprocketest.test/blog',
2 => 'https://wprocketest.test/post-53',
3 => 'https://wprocketest.test/post-2',
4 => 'https://wprocketest.test/gallery-layout',
5 => 'https://wprocketest.test/author/vasilis/',
) |
… a post (#6050) Co-authored-by: Vasilis Manthos <vmanthos@gmail.com>
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
When a post is updated, Cloudflare cache is purged 3 times:
(or on the WordPress Repo: https://plugins.trac.wordpress.org/browser/cloudflare/trunk/cloudflare.loader.php#L113)
Expected behavior
Cloudflare cache should only be purged once.
Additional context
Ticket: https://secure.helpscout.net/conversation/2273098471/424855?folderId=1213662
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: