diff --git a/wp-includes/components/class-wp-service-worker-core-asset-caching-component.php b/wp-includes/components/class-wp-service-worker-core-asset-caching-component.php index 0a4d793ae..c51cf5068 100644 --- a/wp-includes/components/class-wp-service-worker-core-asset-caching-component.php +++ b/wp-includes/components/class-wp-service-worker-core-asset-caching-component.php @@ -31,8 +31,13 @@ public function serve( WP_Service_Worker_Scripts $scripts ) { return; } + $cached_base_url_patterns = array( + preg_quote( trailingslashit( includes_url() ), '/' ) . '.*', + 'https?:\/\/s\.w\.org\/images\/core\/emoji\/.*', + ); + $scripts->caching_routes()->register( - '^' . preg_quote( trailingslashit( includes_url() ), '/' ) . '.*', + '^(' . implode( '|', $cached_base_url_patterns ) . ')', array( // Even though assets should have far-future expiration, network-first is still preferred for development purposes. 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_NETWORK_FIRST,