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

WP Rocket's Cloudflare Add-on causes 524 Error when saving Divi Global Template #7204

Open
suzoutlet opened this issue Dec 25, 2024 · 2 comments
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: medium Issues which are important, but no one will go out of business.

Comments

@suzoutlet
Copy link

suzoutlet commented Dec 25, 2024

Describe the bug
When we have the Cloudflare Add-on enabled and try saving a Divi Global template, we get a 524 error.

This is because when a DIVI global template is updated, Divi iterates all the posts that are using that template, and clears their cache, our Cloudflare Add-on is hooking auto_purge_by_url() to after_rocket_clean_post here.

The auto_purge_by_url will be triggered too many times on big sites, causing the process to timeout after some seconds.

To Reproduce
Steps to reproduce the behavior:

  1. Go to WP settings > ADD-ONs
  2. Enable the Cloudflare Add-on and fill in the details.
  3. Create a Divi Global Template such as a Footer template and apply it to pages (In this case it was applied to 404 pages)
  4. Click on the "Save" button
  5. See that the button keeps spinning and you get a 524 console error.

Suggestion
Doing just a full cache clear in Cloudflare would be more CPU efficient.

Additional context
For now, the following have been added as a temporary fix:

add_action( 'init', function() {
    remove_action( 'et_save_post', 'et_theme_builder_clear_wp_post_cache' );
    add_action( 'et_save_post', 'rocket_clean_domain' );
} );

Slack Thread: https://wp-media.slack.com/archives/C43T1AYMQ/p1734965591441869
HS Ticket: https://secure.helpscout.net/conversation/2795881067/531073

@fairfuturefoundation
Copy link

fairfuturefoundation commented Dec 26, 2024

First of all, I would like to sincerely thank the WP Rocket team and especially @suzoutlet for their outstanding dedication and responsiveness. The temporary solution has truly transformed our site, and I am deeply grateful for your support, especially during the holiday season.

We had significant issues with timeouts when saving Divi templates, but the solution provided effectively resolved these issues. Replacing the et_theme_builder_clear_wp_post_cache action with rocket_clean_domain seems to be a brilliant workaround that balances performance and functionality for large-scale websites like ours.

I appreciate the creation of this GitHub issue as it helps keep users informed and up to date. It is reassuring to see the team actively working with Divi users and developers to find a lasting solution.

WP Rocket is an amazing tool that is constantly evolving, and I am delighted to see such dedication to improving compatibility with other popular WordPress tools.

I look forward to future updates and a sustainable solution! Thanks again for your dedication and for including the community in this process.

Kind regards and Merry Christmas to all

@piotrbak piotrbak added 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: medium Issues which are important, but no one will go out of business. labels Dec 30, 2024
@suzoutlet
Copy link
Author

Thank you so much for your detailed and thoughtful feedback @fairfuturefoundation! I truly appreciate your kind words and the patience you showed throughout the process of diagnosing this issue. My team and I are happy to have been able to assist you.
Wishing you a wonderful new Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: medium Issues which are important, but no one will go out of business.
Projects
None yet
Development

No branches or pull requests

3 participants