GridPane Caching not Detected by WordPress Site Health

If you run the WordPress Site Health check you might find that Page Cache isn’t detected.

This is due to GridPane not providing the correct caching headers that WordPress Site Health is looking for. You can add these headers by utilizing the following code snippet.

// Add GridPane x-grid-srcache-fetch cache header to Site Health checks
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;

This is from the gist at