wp-admin/includes/class-wp-site-health.php:3478Returns a mapping from response headers to an optional callback to verify if page cache is enabled or not.
array<string,One hook fires while WP_Site_Health::get_page_cache_headers() runs, in this order:
Filters the list of cache headers supported by core.
public function get_page_cache_headers(): array { $cache_hit_callback = static function ( $header_value ) { return 1 === preg_match( '/(^| |,)HIT(,| |$)/i', $header_value ); }; $cache_headers = array( // Standard HTTP caching headers. 'cache-control' => static function ( $header_value ) { return (bool) preg_match( '/max-age=[1-9]/', $header_value ); }, 'expires' => static function ( $header_value ) { return strtotime( $header_value ) > time(); }, 'age' => static function ( $header_value ) { return is_numeric( $header_value ) && $header_value > 0; }, 'last-modified' => null, 'etag' => null, 'via' => null, /** * Custom caching headers. * * These do not seem to be actually used by any caching layers. There were first introduced in a Site Health * test in the AMP plugin. They were copied into the Performance Lab plugin's Site Health test before they * were merged into core. * * @link https://github.com/ampproject/amp-wp/pull/6849 * @link https://github.com/WordPress/performance/pull/263 * @link https://core.trac.wordpress.org/changeset/54043 */ 'x-cache-enabled' => static function ( $header_value ) { return ( 'true' === strtolower( $header_value ) ); }, 'x-cache-disabled' => static function ( $header_value ) { return ( 'on' !== strtolower( $header_value ) ); }, /** * CloudFlare. * * @link https://developers.cloudflare.com/cache/concepts/cache-responses/ */ 'cf-cache-status' => $cache_hit_callback, /** * Fastly. * * @link https://www.fastly.com/documentation/reference/http/http-headers/X-Cache/ */ 'x-cache' => $cache_hit_callback, /** * LightSpeed. * * @link https://docs.litespeedtech.com/lscache/devguide/controls/#x-litespeed-cache */ 'x-litespeed-cache' => $cache_hit_callback, /** * OpenResty srcache-nginx-module. * * The `x-srcache-store-status` header indicates if the response was stored in the cache. * Valid values include `STORE` and `BYPASS`. * * The `x-srcache-fetch-status` header indicates if the response was fetched from the cache. * Valid values include `HIT`, `MISS`, and `BYPASS`. * * @link https://github.com/openresty/srcache-nginx-module */ 'x-srcache-store-status' => static function ( $header_value ) { return 'store' === strtolower( $header_value ); }, 'x-srcache-fetch-status' => $cache_hit_callback, /** * Nginx. * * @link https://blog.nginx.org/blog/nginx-caching-guideIntroduced in 6.1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
array to array<string,.verified against sourcesrc/wp-admin/includes/class-wp-site-health.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.