title: Service Worker Data Cached but Returns 504 When offline
body: <p>My Angular applications static js files are in a nginx server which is hosted in a docker container. Installability works fine, and the data responses from the API requests are in the cached storage. When online - the API requests return 200 (from service worker) as below.
  But when request is made to same api when offline it returns 504 (from Service Worker).</p>
  <p><a href="https://i.stack.imgur.com/SjkC3.png" rel="nofollow noreferrer">504 when offline</a></p>
  <pre><code>{
  &quot;$schema&quot;: &quot;./node_modules/@angular/service-worker/config/schema.json&quot;,
  &quot;index&quot;: &quot;/index.html&quot;,
  &quot;assetGroups&quot;: [{
      &quot;name&quot;: &quot;app&quot;,
      &quot;installMode&quot;: &quot;prefetch&quot;,
      &quot;resources&quot;: {
          &quot;files&quot;: [
              &quot;/favicon.ico&quot;,
              &quot;/index.html&quot;,
              &quot;/manifest.webmanifest&quot;,
              &quot;/*.css&quot;,
              &quot;/*.js&quot;
          ]
      }
  }, {
      &quot;name&quot;: &quot;assets&quot;,
      &quot;installMode&quot;: &quot;lazy&quot;,
      &quot;updateMode&quot;: &quot;lazy&quot;,
      &quot;resources&quot;: {
          &quot;files&quot;: [
              &quot;/assets/**&quot;,
              &quot;/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)&quot;
          ]
      }
  }],
  &quot;dataGroups&quot;: [{
      &quot;name&quot;: &quot;my-api&quot;,
      &quot;urls&quot;: [
          &quot;/**/MyService.svc*&quot;
      ],
      &quot;cacheConfig&quot;: {
          &quot;strategy&quot;: &quot;freshness&quot;,
          &quot;maxSize&quot;: 1000,
          &quot;maxAge&quot;: &quot;7d&quot;,
          &quot;timeout&quot;: &quot;5s&quot;
      }
  }] }
  </code></pre>
  <p>I assume the path restrictions are correct as when i test using http server locally it works fine.</p>