keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

update output buffering timing to start earlier #168

Closed coreykn closed 4 years ago

coreykn commented 4 years ago

Updated output buffering to start even earlier on the advanced-cache.php drop-in instead of the init hook. This builds upon what was added in PR #137 and became possible with the cache engine introduced in PR #147. While the previous changes introduced increased the compatibility with other plugins (#78) it turns out starting on the init hook with the default priority still has compatibility issues with some plugins that start earlier (#120). Since delivering the cache requires the advanced-cache.php drop-in, which itself relies on the WP_CACHE constant being defined as true, as well as the settings file existing, it also makes sense for page caching to rely on both as well. This is the earliest Cache Enabler can start the output buffering, which should prevent any issues like this arising in the future.

The following updates to the caching process were updated because of this change: