diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3644d8d..a4e937dca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This is an alpha version! The changes listed here are not final. - Concatenate JS/CSS: Add a button that allows loading default excludes. - General: Added tracks events to clickable elements on the settings page. - General: Add WordPress filters to allow Cornerstone Pages list and Image Size Analyzer source data to be updated. +- Minify: Added HTTP header to take advantage of WordPress.com edge caching - UI: Add notifications when interacting with dashboard settings. ### Changed diff --git a/app/lib/minify/functions-service.php b/app/lib/minify/functions-service.php index 20812b65b..08fbd8997 100644 --- a/app/lib/minify/functions-service.php +++ b/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 ) . '"' );