/x-grid-srcache-fetch Secret
Created
January 5, 2023 00:17
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