title: make workbox cache cross origin requests with regex route
body: <p>i want to cache all json resources in a directory on my websites's cdn with workbox service worker</p>
  
  <p>resources url :</p>
  
  <pre><code>https://cdn.example.com/mydir/*.json
  </code></pre>
  
  <p>and my service worker is at:</p>
  
  <pre><code>https://example.com/service-worker.js
  </code></pre>
  
  <p>i wrote my cache code as below</p>
  
  <pre><code>workbox.routing.registerRoute(
      /mydir\/.+\.json$/,
      new workbox.strategies.CacheFirst({
          plugins: [
              new workbox.cacheableResponse.Plugin({
                  statuses: [0, 200]
              })
          ]
      })
  );
  </code></pre>
  
  <p>but i get this error from workbox:</p>
  
  <pre><code>The regular expression '/mydir\/.+\.json$/' only partially matched against the cross-origin URL 'https://cdn.example.com/mydir/test.json'. RegExpRoute's will only handle cross-origin requests if they match the entire URL.
  </code></pre>
  
  <p>how can i cache these resources in my service worker ? any idea ?</p>