get_page_cache_headers example

/** * Tests if a full page cache is available. * * @since 6.1.0 * * @return array The test result. */
    public function get_test_page_cache() {
        $description  = '<p>' . __( 'Page cache enhances the speed and performance of your site by saving and serving static pages instead of calling for a page every time a user visits.' ) . '</p>';
        $description .= '<p>' . __( 'Page cache is detected by looking for an active page cache plugin as well as making three requests to the homepage and looking for one or more of the following HTTP client caching response headers:' ) . '</p>';
        $description .= '<code>' . implode( '</code>, <code>', array_keys( $this->get_page_cache_headers() ) ) . '.</code>';

        $result = array(
            'badge'       => array(
                'label' => __( 'Performance' ),
                'color' => 'blue',
            ),
            'description' => wp_kses_post( $description ),
            'test'        => 'page_cache',
            'status'      => 'good',
            'label'       => '',
            'actions'     => sprintf(
                
Home | Imprint | This part of the site doesn't use cookies.