Proposal: Persistent Object Cache and Full Page Cache Site Health Checks
This proposal seeks to integrate two new Site Health checks for Persistent Object Cache and Full Page Cache into WordPress core, targeting the WordPress 6.1 release.
Context
Providing valuable recommendations for site owners is crucial to improving WordPress performance. These two modules are the first in a series of Site Health modules that the performance team is working on. Acknowledging performance problems is the first step to solving them.
The modules were originally proposed and developed by members of the performance team and are available as modules inside the Performance Lab plugin.
Project update
Development of the features has been ongoing in the Performance Lab plugin repository on GitHub,
- Persistent Object Cache module – Available since 1.0.0-beta.1
- Audit Full Page Cache module – Available since 1.2.0
The recently released version 1.2.0 of the Performance Lab plugin contains both modules in a state that is ready to merge into core.
The team is currently migrating the module code into WordPress core patches in 2 Trac tickets:
- Persistent Object Cache Health Check from performance plugin to core (#56040)
- Port Audit Full Page Cache from performance plugin to core (#56041)
Any reviews and feedback on the core patches would be greatly appreciated.
Customizing the audits
We’ve added a series of filters to make messaging and suggestions customizable. These filters can be used by hosting providers to provide their own personalized suggestions on how to address the Site Health feedback.
Persistent Object Cache filters
Hosts may want to replace the notes to recommend their preferred object caching solution:
apply_filters( 'site_status_persistent_object_cache_notes', $notes, $available_services );
Hosts may want to replace the original link to WordPress documentation with a link to their own guide:
apply_filters( 'site_status_persistent_object_cache_url', __('https://wordpress.org/support/article/optimization/#object-caching' ));
Hosts or site owners may want to bypass thresholds and force suggestions, or filter them to determine whether to suggest the use of a persistent object cache:
apply_filters( 'site_status_suggest_persistent_object_cache', false );
apply_filters(
'site_status_persistent_object_cache_thresholds',
array(
'alloptions_count' => 500,
'alloptions_bytes' => 100000,
'comments_count' => 1000,
'options_count' => 1000,
'posts_count' => 1000,
'terms_count' => 1000,
'users_count' => 1000,
)
);
Full Page Cache filters
Developers can filter the threshold below which a response time is considered good:
apply_filters( 'page_cache_good_response_time_threshold', 600 );
Testing and feedback
You can test the modules in v1.2.0 or later of the Performance Lab plugin. Both modules should be enabled by default, but you can double-check that they are enabled in Settings > Performance:
Once enabled, you can view the test results on the Site Health Status screen at Tools > Site Health > Status.
We encourage you to test these modules (and others) from the Performance Lab Plugin, report any bugs in our GitHub repository, or contribute with fixes and ideas. You can also share any feedback, concerns, or questions to improve these features further in the comments.
Thanks to @shetheliving and @flixos90 for peer review.