diff --git a/projects/plugins/boost/app/lib/minify/functions-service.php b/projects/plugins/boost/app/lib/minify/functions-service.php index 20812b65b62d2..08fbd8997447d 100644 --- a/projects/plugins/boost/app/lib/minify/functions-service.php +++ b/projects/plugins/boost/app/lib/minify/functions-service.php @@ -60,6 +60,10 @@ function jetpack_boost_page_optimize_service_request() { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $etag = '"' . md5( file_get_contents( $cache_file ) ) . '"'; + // Check if we're on Atomic and take advantage of the Atomic Edge Cache. + if ( defined( 'ATOMIC_CLIENT_ID' ) ) { + header( 'A8c-Edge-Cache: cache' ); + } header( 'X-Page-Optimize: cached' ); header( 'Cache-Control: max-age=' . 31536000 ); header( 'ETag: ' . $etag ); @@ -77,6 +81,10 @@ function jetpack_boost_page_optimize_service_request() { foreach ( $headers as $header ) { header( $header ); } + // Check if we're on Atomic and take advantage of the Atomic Edge Cache. + if ( defined( 'ATOMIC_CLIENT_ID' ) ) { + header( 'A8c-Edge-Cache: cache' ); + } header( 'X-Page-Optimize: uncached' ); header( 'Cache-Control: max-age=' . 31536000 ); header( 'ETag: "' . md5( $content ) . '"' ); diff --git a/projects/plugins/boost/changelog/add-edge-cache-header b/projects/plugins/boost/changelog/add-edge-cache-header new file mode 100644 index 0000000000000..534f4a2e449ff --- /dev/null +++ b/projects/plugins/boost/changelog/add-edge-cache-header @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Minify: Added HTTP header to take advantage of WordPress.com edge caching