Make WordPress Core


Ignore:
Timestamp:
08/31/2022 10:44:04 PM (21 months ago)
Author:
flixos90
Message:

Site Health: Introduce page cache check.

This changeset adds a new page_cache check which determines whether the site uses a full page cache, and in addition assesses the server response time. If no page cache is present and the server response time is slow, the check will suggest use of a page cache.

A few filters are included for customization of the check:

  • site_status_good_response_time_threshold filters the number of milliseconds below which the server response time is considered good. The default value is based on the server-response-time Lighthouse audit and can be altered using this filter.
  • site_status_page_cache_supported_cache_headers filters the map of supported cache headers and their callback to determine whether it was a cache hit. The default list includes commonly used cache headers, and it is filterable to support e.g. additional cache headers used by specific vendors.

Note that due to the nature of this check it is only run in production environments.

Props furi3r, westonruter, spacedmonkey, swissspidy, Clorith.
Fixes #56041.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r53464 r54043  
    184184            '/wp-site-health/v1/tests/dotorg-communication',
    185185            '/wp-site-health/v1/tests/authorization-header',
     186            '/wp-site-health/v1/tests/page-cache',
    186187            '/wp-site-health/v1/directory-sizes',
    187188        );
Note: See TracChangeset for help on using the changeset viewer.