Skip to content

Commit 2cea537

Browse files
committed
Add caching of emoji from s.w.org
1 parent 4b51a2b commit 2cea537

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wp-includes/components/class-wp-service-worker-core-asset-caching-component.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ public function serve( WP_Service_Worker_Scripts $scripts ) {
3131
return;
3232
}
3333

34+
$cached_base_url_patterns = array(
35+
preg_quote( trailingslashit( includes_url() ), '/' ) . '.*',
36+
'https?:\/\/s\.w\.org\/images\/core\/emoji\/.*',
37+
);
38+
3439
$scripts->caching_routes()->register(
35-
'^' . preg_quote( trailingslashit( includes_url() ), '/' ) . '.*',
40+
'^(' . implode( '|', $cached_base_url_patterns ) . ')',
3641
array(
3742
// Even though assets should have far-future expiration, network-first is still preferred for development purposes.
3843
'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_NETWORK_FIRST,

0 commit comments

Comments
 (0)