[ad_1]
By prefetched do you mean “precached“?
Yes, sorry, there is the rel=prefetch thing I was looking into, so I posted that way.
You can see documentation for this in the wiki under Route Caching API. In particular, here’s how you would precache an image:
<?php
add_action( 'wp_front_service_worker', function( \WP_Service_Worker_Scripts $scripts ) {
$scripts->precaching_routes()->register(
'https://example.com/wp-content/themes/my-theme/my-theme-image.png',
array(
'revision' => get_bloginfo( 'version' ),
)
);
} );You can duplicate that register call as, any times as you need.
