You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'description' => '<p>' . esc_html__( 'If the Cache-Control response header includes directives like no-store, no-cache, or max-age=0 then it can prevent instant back/forward navigations (using the browser bfcache). Your site is configured properly.', 'performance-lab' ) . '</p>',
31
+
'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' ),
$result['label'] = __( 'Unable to check whether the Cache-Control page header is compatible with fast back/forward navigations', 'performance-lab' );
46
49
$result['status'] = 'recommended';
47
50
$result['description'] = '<p>' . wp_kses(
48
51
sprintf(
49
52
/* translators: 1: the error code, 2: the error message */
50
-
__( 'The request to check the Cache-Control response header responded with error code <code>%1$s</code> and the following error message: %2$s.', 'performance-lab' ),
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' ),
$result['label'] = __( 'Cache-Control header is preventing fast back/forward navigations', 'performance-lab' );
80
+
if ( count( $flagged_headers ) > 0 ) {
81
+
$result['label'] = __( 'The Cache-Control page header is preventing fast back/forward navigations', 'performance-lab' );
80
82
$result['status'] = 'recommended';
81
83
$result['description'] = sprintf(
82
-
'<p>%s</p>',
83
-
sprintf(
84
-
/* translators: %s: Cache-Control header value */
85
-
esc_html__( 'Cache-Control headers are set to %s. This can affect the performance of your site by preventing fast back/forward navigations (via browser bfcache).', 'performance-lab' ),
86
-
$flagged_headers_string
87
-
)
84
+
'<p>%s %s</p>',
85
+
wp_kses(
86
+
sprintf(
87
+
/* translators: %s: problematic directive(s) */
88
+
_n(
89
+
'The <code>Cache-Control</code> response header for the home page includes the following directive: %s.',
90
+
'The <code>Cache-Control</code> response header for the home page includes the following directives: %s.',
91
+
count( $flagged_headers ),
92
+
'performance-lab'
93
+
),
94
+
implode(
95
+
', ',
96
+
array_map(
97
+
staticfunction ( $header ) {
98
+
return"<code>$header</code>";
99
+
},
100
+
$flagged_headers
101
+
)
102
+
)
103
+
),
104
+
array( 'code' => array() )
105
+
),
106
+
esc_html__( 'This can affect the performance of your site by preventing fast back/forward navigations (via browser bfcache).', 'performance-lab' )
Copy file name to clipboardExpand all lines: plugins/performance-lab/tests/includes/site-health/bfcache-compatibility-headers/test-bfcache-compatibility-headers.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -82,32 +82,32 @@ public function data_test_bfcache_compatibility(): array {
'If the Cache-Controlresponse header includes directives like no-store, no-cache, or max-age=0 then it can prevent instant back/forward navigations (using the browser bfcache). Your site is configured properly.',
85
+
'If the <code>Cache-Control</code> page response header includes directives like',
0 commit comments