Skip to content

Commit fe7444b

Browse files
committed
Further clarify that the bfcache is for unauthenticated requests
1 parent b65be42 commit fe7444b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

plugins/performance-lab/includes/site-health/bfcache-compatibility-headers/helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function perflab_bfcache_compatibility_headers_check(): array {
2929
'color' => 'blue',
3030
),
3131
'description' => '<p>' . wp_kses(
32-
__( 'If the <code>Cache-Control</code> page response header includes directives like <code>no-store</code>, <code>no-cache</code>, or <code>max-age=0</code> then it can prevent instant back/forward navigations (using the browser bfcache). Your site is configured properly.', 'performance-lab' ),
32+
__( 'If the <code>Cache-Control</code> page response header includes directives like <code>no-store</code>, <code>no-cache</code>, or <code>max-age=0</code> then it can prevent instant back/forward navigations (using the browser bfcache). These are not present for unauthenticated requests on your site, so it is configured properly. Note that WordPress adds these directives for logged-in page responses.', 'performance-lab' ),
3333
array( 'code' => array() )
3434
) . '</p>',
3535
'actions' => '',
@@ -50,7 +50,7 @@ function perflab_bfcache_compatibility_headers_check(): array {
5050
$result['description'] = '<p>' . wp_kses(
5151
sprintf(
5252
/* translators: 1: the error code, 2: the error message */
53-
__( 'The request to check the <code>Cache-Control</code> response header for the home page resulted in an error with code <code>%1$s</code> and the following message: %2$s.', 'performance-lab' ),
53+
__( 'The unauthenticated request to check the <code>Cache-Control</code> response header for the home page resulted in an error with code <code>%1$s</code> and the following message: %2$s.', 'performance-lab' ),
5454
esc_html( (string) $response->get_error_code() ),
5555
esc_html( rtrim( $response->get_error_message(), '.' ) )
5656
),
@@ -83,8 +83,8 @@ function perflab_bfcache_compatibility_headers_check(): array {
8383
sprintf(
8484
/* translators: %s: problematic directive(s) */
8585
_n(
86-
'The <code>Cache-Control</code> response header for the home page includes the following directive: %s.',
87-
'The <code>Cache-Control</code> response header for the home page includes the following directives: %s.',
86+
'The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directive: %s.',
87+
'The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directives: %s.',
8888
count( $found_directives ),
8989
'performance-lab'
9090
),

plugins/performance-lab/tests/includes/site-health/bfcache-compatibility-headers/test-bfcache-compatibility-headers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,27 @@ public function data_test_bfcache_compatibility(): array {
8787
'no_store' => array(
8888
$this->build_response( 200, array( 'cache-control' => 'no-store' ) ),
8989
'recommended',
90-
'The <code>Cache-Control</code> response header for the home page includes the following directive: <code>no-store</code>',
90+
'<p>The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directive: <code>no-store</code>',
9191
),
9292
'no_cache' => array(
9393
$this->build_response( 200, array( 'cache-control' => 'no-cache' ) ),
9494
'recommended',
95-
'The <code>Cache-Control</code> response header for the home page includes the following directive: <code>no-cache</code>',
95+
'<p>The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directive: <code>no-cache</code>',
9696
),
9797
'max_age_0' => array(
9898
$this->build_response( 200, array( 'cache-control' => 'max-age=0' ) ),
9999
'recommended',
100-
'The <code>Cache-Control</code> response header for the home page includes the following directive: <code>max-age=0</code>',
100+
'<p>The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directive: <code>max-age=0</code>',
101101
),
102102
'max_age_0_no_store' => array(
103103
$this->build_response( 200, array( 'cache-control' => 'max-age=0, no-store' ) ),
104104
'recommended',
105-
'The <code>Cache-Control</code> response header for the home page includes the following directives: <code>no-store</code>, <code>max-age=0</code>',
105+
'<p>The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the following directives: <code>no-store</code>, <code>max-age=0</code>',
106106
),
107107
'error' => array(
108108
new WP_Error( 'http_request_failed', 'HTTP request failed' ),
109109
'recommended',
110-
'The request to check the <code>Cache-Control</code> response header for the home page resulted in an error with code',
110+
'The unauthenticated request to check the <code>Cache-Control</code> response header for the home page resulted in an error with code',
111111
),
112112
);
113113
}

0 commit comments

Comments
 (0)