How to make workbox cache cross origin responses?
问题 According to workbox doc, cross domain request should be configured to ensure that regular expression matches the beginning of the URL. However, it doesn't work. The service worker code is like below. importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-sw.js'); workbox.routing.registerRoute( /.*\.(png|jpg|jpeg|svg|gif)/, workbox.strategies.cacheFirst() ); workbox.routing.registerRoute( new RegExp('^https://a248.e.akamai.net/.*'), workbox.strategies.cacheFirst() );