Skip to content

Experimental Request Handler breaks WP Rocket #406

Open
@RafaelKr

Description

@RafaelKr

Version

4.3.0

What did you expect to happen?

In a Radicle project we have the experimental Request handler enabled via ACORN_ENABLE_EXPERIMENTAL_WORDPRESS_REQUEST_HANDLER=true.

We now installed WP Rocket (Previously we had WP Optimize where it also didn't work).

It should create static html files inside public/content/cache/wp-rocket/example.com

What actually happens?

It only creates those static html files when the experimental request handler is disabled.

It's related to output buffering. WP Rocket receives an empty output buffer at https://github.com/wp-media/wp-rocket/blob/09708aa55d362a9535ad4d45cb68280325efaecb/inc/classes/Buffer/class-cache.php#L259

The order of calls is:

When we disable the experimental request handler the buffer contains the correct content and the static file is generated.

Steps to reproduce

  • Add ACORN_ENABLE_EXPERIMENTAL_WORDPRESS_REQUEST_HANDLER=true to .env
  • composer install wp-media/wp-rocket
  • Activate WP Rocket (By default it will add define( 'WP_CACHE', true ); // Added by WP Rocket to wp-config.php, but that should be fine for testing. Can be disabled via https://docs.wp-rocket.me/article/958-how-to-use-wp-rocket-with-bedrock-wordpress-boilerplate)
  • Go to public/content/cache/wp-rocket/your-domain.localhost (or the wp-content path which is configured without Radicle)
  • Load a page and see that there are no generated files
  • Remove ACORN_ENABLE_EXPERIMENTAL_WORDPRESS_REQUEST_HANDLER=true from .env
  • Load a page and now it should generate static files

System info

No response

Log output

No response

Please confirm this isn't a support request.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions