title: Workbox routing for images in subfolders
body: <p>I am using workbox to manage the caching of my assets, which works great.</p>
  
  <p>I am having 1 or 2 issues with regular expressions when caching my images:</p>
  
  <p>I am trying to cache all images in the images folder &amp; icons subfolder (image of folder structure below)</p>
  
  <p>I have tried the following to try and cache the images:</p>
  
  <pre><code>workbox.routing.registerRoute(
    /images\/.(?:png|gif|jpg|jpeg|svg|ico|webp)$/,  //&lt;-- Regexp
    workbox.strategies.cacheFirst({
     cacheName: 'images',
     plugins: [
      new workbox.expiration.Plugin({
        maxEntries: 100,
        maxAgeSeconds: 60 * 60 * 24 * 365
      }),
    ],
   }),
  );
  
  //I also tried a regexp on the entire images folder
  workbox.routing.registerRoute(
    new RegExp('^/images/'),    //&lt;-- Regexp
    workbox.strategies.cacheFirst({
      cacheName: 'images',
      plugins: [
        new workbox.expiration.Plugin({
          maxEntries: 100,
          maxAgeSeconds: 60 * 60 * 24 * 365
        }),
      ],
    }),
  );
  </code></pre>
  
  <p>I included the code samples above to give context to what I am trying to achieve</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Folder Structure:</p>
  
  <p><a href="https://i.stack.imgur.com/OntNQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OntNQ.jpg" alt="enter image description here"></a></p>