Skip to content

Instantly share code, notes, and snippets.

@razorfrog
Created January 5, 2023 00:17
Show Gist options
  • Save razorfrog/af12d2a251bcac4ca43356b9ea2da0e8 to your computer and use it in GitHub Desktop.
Save razorfrog/af12d2a251bcac4ca43356b9ea2da0e8 to your computer and use it in GitHub Desktop.
Add GridPane x-grid-srcache-fetch cache header to Site Health checks
//////////////////////////////////////////////////////////////////////////////
// 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