Manually generate cache for service worker

[ad_1]

Dear Goossens

Many thanks for this extremely helpful plugin.

Just wondered if it’s possible to have the ability to generate all the static autoptimize_hash.css/js files manually in bulk, and not wait until a page gets actually hit.

We recently implemented a service worker using GoogleChromeLabs’ pwa-wp plugin, and turns out it could only precache an asset when first activated on a page if the assets for the pages to be precached already exist in some directory:

workbox.routing.registerRoute(/wp-content\/cache\/autoptimize\/.+/, workbox.strategies.cacheFirst());

So it seems like a capability to manually generate css/js cache is needed for a service worker to work with Autoptimize.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer