New cache Site Health checks in WordPress 6.1

<div style&equals;"text-align&colon;center"><img src&equals;"data&colon;image&sol;gif&semi;base64&comma;R0lGODlhAQABAIAAAAAAAP&sol;&sol;&sol;ywAAAAAAQABAAACAUwAOw&equals;&equals;" fifu-lazy&equals;"1" fifu-data-sizes&equals;"auto" fifu-data-srcset&equals;"https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;75&resize&equals;75&ssl&equals;1 75w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;100&resize&equals;100&ssl&equals;1 100w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;150&resize&equals;150&ssl&equals;1 150w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;240&resize&equals;240&ssl&equals;1 240w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;320&resize&equals;320&ssl&equals;1 320w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;500&resize&equals;500&ssl&equals;1 500w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;640&resize&equals;640&ssl&equals;1 640w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;800&resize&equals;800&ssl&equals;1 800w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;1024&resize&equals;1024&ssl&equals;1 1024w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;1280&resize&equals;1280&ssl&equals;1 1280w&comma; https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1&w&equals;1600&resize&equals;1600&ssl&equals;1 1600w" width&equals;"1600" height&equals;"694" fifu-data-src&equals;"https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1" class&equals;"attachment-post-thumbnail size-post-thumbnail wp-post-image" alt&equals;"New cache Site Health checks in WordPress 6&period;1" title&equals;"New cache Site Health checks in WordPress 6&period;1" srcset&equals;"https&colon;&sol;&sol;i2&period;wp&period;com&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1&period;png&quest;ssl&equals;1 1600w&comma; https&colon;&sol;&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1-300x130&period;png 300w&comma; https&colon;&sol;&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1-1024x444&period;png 1024w&comma; https&colon;&sol;&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1-768x333&period;png 768w&comma; https&colon;&sol;&sol;www&period;awordpresscommenter&period;com&sol;wp-content&sol;uploads&sol;2022&sol;10&sol;new-cache-site-health-checks-in-wordpress-6-1-1536x666&period;png 1536w" sizes&equals;"&lpar;max-width&colon; 1600px&rpar; 100vw&comma; 1600px" &sol;><&sol;div><div>&NewLine;<p>As part of the WordPress 6&period;1 release&comma; the <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;performance&sol;">Performance Team<&sol;a> has added two Site Health checks &lpar;Persistent Object Cache and Page Cache&rpar;&period; These checks were previously tested in the <a href&equals;"https&colon;&sol;&sol;wordpress&period;org&sol;plugins&sol;performance-lab&sol;">Performance Lab plugin<&sol;a>&period; You can read more about them in the original <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;2022&sol;07&sol;13&sol;proposal-persistent-object-cache-and-full-page-cache-site-health-checks&sol;">proposal<&sol;a>&period;<&sol;p>&NewLine;<p>Both checks will run only in a production environment&period;<&sol;p>&NewLine;<h2>Persistent Object Cache<&sol;h2>&NewLine;<p>This new check determines whether the site uses a persistent object cache or not and recommends it if it makes sense for the site&period; It also links to a <a href&equals;"https&colon;&sol;&sol;wordpress&period;org&sol;support&sol;article&sol;optimization&sol;&num;persistent-object-cache">support resource<&sol;a> created for the check&period;<&sol;p>&NewLine;<p>A few filters have been included aiming for hosting providers to provide more specific steps regarding their environment&period;<&sol;p>&NewLine;<p>Hosts may use the <code>site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;url<&sol;code> filter to replace the original WordPress guide with their own guide&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Filter the Persistent object cache URL&period;&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;url'&comma; function&lpar;&rpar; &lbrace;&NewLine;&Tab;return 'https&colon;&sol;&sol;awesomewphosting&period;com&sol;optimization&sol;persistent-object-cache'&semi;&NewLine;&rcub; &rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Hosts may use the <code>site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;notes<&sol;code> filter to customize the notes to recommend their preferred object cache solution&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Update the persistent object cache notes&period;&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;notes'&comma; function&lpar; &dollar;notes &rpar; &lbrace;&NewLine;&Tab;&dollar;notes &equals; &lowbar;&lowbar;&lpar; 'The updated notes can go here as text&period;'&comma; 'text-domain' &rpar;&semi;&NewLine;&NewLine;&Tab;return &dollar;notes&semi;&NewLine;&rcub; &rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>The <code>site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;thresholds<&sol;code> filter allows modifying the thresholds above WordPress considers using a persistent object cache beneficial&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Override the whole &dollar;thresholds array&comma; or any specific indexes as required&period;&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;persistent&lowbar;object&lowbar;cache&lowbar;thresholds'&comma; function&lpar; &dollar;thresholds &rpar; &lbrace;&NewLine;&Tab;&dollar;thresholds &equals; array&lpar;&NewLine;&Tab;&Tab;'alloptions&lowbar;count' &equals;> 600&comma;&NewLine;&Tab;&Tab;'alloptions&lowbar;bytes' &equals;> 200000&comma;&NewLine;&Tab;&Tab;'comments&lowbar;count' &equals;> 2000&comma;&NewLine;&Tab;&Tab;'options&lowbar;count' &equals;> 2000&comma;&NewLine;&Tab;&Tab;'posts&lowbar;count' &equals;> 2000&comma;&NewLine;&Tab;&Tab;'terms&lowbar;count' &equals;> 2000&comma;&NewLine;&Tab;&Tab;'users&lowbar;count' &equals;> 2000&comma;&NewLine;&Tab;&rpar;&semi;&NewLine;&NewLine;&Tab;return &dollar;thresholds&semi;&NewLine;&rcub; &rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Alternatively&comma; <code>site&lowbar;status&lowbar;should&lowbar;suggest&lowbar;persistent&lowbar;object&lowbar;cache<&sol;code> is a short-circuit filter that allows using entirely custom logic to determine whether a persistent object cache would make sense for the site&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Opt in for suggesting the persistent object cache&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;should&lowbar;suggest&lowbar;persistent&lowbar;object&lowbar;cache'&comma; '&lowbar;&lowbar;return&lowbar;true' &rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>For additional context on this new check&comma; see <a href&equals;"https&colon;&sol;&sol;core&period;trac&period;wordpress&period;org&sol;ticket&sol;56040" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">&num;56040<&sol;a>&period;<&sol;p>&NewLine;<h2>Full Page Cache<&sol;h2>&NewLine;<p>This new check determines whether the site is using a full page cache solution and if the response time is acceptable&period;<&sol;p>&NewLine;<p>It also adds a couple of filters aiming for hosting companies to customize the response threshold and add their own cache headers to be detected&period; <&sol;p>&NewLine;<p>The <code>site&lowbar;status&lowbar;good&lowbar;response&lowbar;time&lowbar;threshold<&sol;code> filter allows modifying the current threshold of 600ms&period; Everything below this will be considered acceptable&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Filter the response time threshold&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;good&lowbar;response&lowbar;time&lowbar;threshold'&comma; function&lpar;&rpar; &lbrace;&NewLine;&Tab;return 200&semi;&NewLine;&rcub; &rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Additional custom cache headers &lpar; and optionally their verification callbacks&rpar; can be added through the <code>site&lowbar;status&lowbar;page&lowbar;cache&lowbar;supported&lowbar;cache&lowbar;headers<&sol;code> filter&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;&sol;&ast;&ast;&NewLine; &ast; Filter the page cache supported cache headers&NewLine; &ast; &dollar;cache&lowbar;headers contains List of client caching headers and their &lpar;optional&rpar; verification callbacks&period;&NewLine; &ast;&sol;&NewLine;add&lowbar;filter&lpar; 'site&lowbar;status&lowbar;page&lowbar;cache&lowbar;supported&lowbar;cache&lowbar;headers'&comma; function&lpar; &dollar;cache&lowbar;headers &rpar; &lbrace;&NewLine;&Tab;&sol;&sol; Add new header to the existing list&period;&NewLine;&Tab;&dollar;cache&lowbar;headers&lbrack;'cf-cache-status'&rsqb; &equals; static function &lpar; &dollar;header&lowbar;value &rpar; &lbrace;&NewLine;&Tab;&Tab;return false &excl;&equals;&equals; strpos&lpar; strtolower&lpar; &dollar;header&lowbar;value &rpar;&comma; 'hit' &rpar;&semi;&NewLine;&Tab;&rcub;&semi;&NewLine;&Tab;return &dollar;cache&lowbar;headers&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>For additional context on this new check&comma; see <a href&equals;"https&colon;&sol;&sol;core&period;trac&period;wordpress&period;org&sol;ticket&sol;56041">&num;56041<&sol;a>&period;<&sol;p>&NewLine;<p class&equals;"has-text-align-right"><em>Thanks to <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;flixos90&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>flixos90<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;milana&lowbar;cap&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>milana&lowbar;cap<&sol;a>&comma; <&sol;em><a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;spacedmonkey&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>spacedmonkey<&sol;a><em> for peer review&comma; and <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;pushpakpop&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>pushpakpop<&sol;a> for the code examples&period;<&sol;em><&sol;p>&NewLine;<&sol;p>&NewLine;<p class&equals;"o2-appended-tags"><a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;6-1&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>6-1<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;core-site-health&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>core-site-health<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;dev-notes&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>dev-notes<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;dev-notes-6-1&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>dev-notes-6-1<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;performance&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>performance<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;performance-lab&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>performance-lab<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;site-health&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>site-health<&sol;a><&sol;p>&NewLine;<&sol;div>&NewLine;

Sponsored
Sponsored
A WordPress Commenter

Recent Posts

WPManageNinja Launches FluentCart, Aiming to Bring Speed and Simplicity to Ecommerce for WordPress

A new ecommerce contender has entered the WordPress space. This week, WPManageNinja officially launched FluentCart,…

2 days ago

The WP Minute Launches Courses, Starting With WordPress Hosting

The WP Minute is stepping into education. The publication best known for its interviews, podcasts,…

2 days ago

10Web Launches Vibe for WordPress, Another AI Builder That Turns Prompts Into Full Sites

AI-powered site builders are having a moment in WordPress, and 10Web is the latest company…

2 days ago

From Treehouses to Tech: The Lifelong Friendship Behind DocsBot

For as long as Aaron Edwards and Joshua Dailey have known each other, they’ve been…

3 days ago

Judge Reins In Discovery Fight as WP Engine Ordered to Produce Customer Data

A U.S. magistrate judge has moved to rein in the escalating discovery battle between WP…

5 days ago

Ollie’s Menu Designer Flagged for Core, With Automattic Developers Set to Help Shepherd It

Ollie’s “game-changing” Menu Designer plugin is moving toward inclusion in WordPress core. Anne McCarthy says…

1 week ago