Skip to content

Conversation

tombroucke
Copy link
Contributor

This PR should resolve #406

The registerWordPressRoute method deletes all levels of output buffering. Caching plugins try to buffer the whole output and write that to a file. Output buffering is started by caching plugins in {wp-content|app}/advanced-cache.php, and saved in a callback for that ob_start(). As acorn is deleting all buffers from all levels in Bootable::registerWordPressRoute(), the output is empty by the time the caching plugin's callback is called.

With this PR, we get the initial ob level, and delete buffers up until this level.

I have tested this fix with

@tombroucke
Copy link
Contributor Author

This also fixes #423

Copy link
Member

@QWp6t QWp6t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Thanks! 🙏

@QWp6t QWp6t merged commit 6e1a5ba into roots:main Aug 26, 2025
2 checks passed
@RafaelKr
Copy link
Contributor

Very clean, thank you very much!

@dsturm
Copy link
Contributor

dsturm commented Sep 2, 2025

FYI: I ran into an issue with RealCookieBanner, where using Wordpress routing would fail to load an essential taxonomy and therefor generated multiple PHP errors. This PR fixed this problem.

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.

Experimental Request Handler breaks WP Rocket
4 participants