-
-
Save razorfrog/af12d2a251bcac4ca43356b9ea2da0e8 to your computer and use it in GitHub Desktop.
Add GridPane x-grid-srcache-fetch cache header to Site Health checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////////////////////////////////////////// | |
// Add GridPane x-grid-srcache-fetch cache header to Site Health checks | |
// https://make.wordpress.org/core/2022/10/06/new-cache-site-health-checks-in-wordpress-6-1/ | |
////////////////////////////////////////////////////////////////////////////// | |
add_filter( 'site_status_page_cache_supported_cache_headers', function( $cache_headers ) { | |
// Add new header to the existing list. | |
$cache_headers['x-grid-srcache-fetch'] = static function ( $header_value ) { | |
return false !== strpos( strtolower( $header_value ), 'hit' ); | |
}; | |
return $cache_headers; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment