title: Angular Service Worker, caching api calls for offline app
body: <p>I'm trying to make the service worker in angular work with API requests.
  I'd like the app to work offline and I've the below config:</p>
  
  <pre><code>    {
          "name": "api",
          "urls": ["https://x.com/**"],
          "cacheConfig": {
              "strategy": "performance",
              "maxSize": 20,
              "maxAge": "365d",
              "timeout": "5s"
          }
      }
  </code></pre>
  
  <p>Here is what the xhr tab looks like when I'm offline:</p>
  
  <p><a href="https://i.stack.imgur.com/6cE6v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6cE6v.png" alt="enter image description here"></a></p>
  
  <p>and this is the content of the user request:</p>
  
  <p><a href="https://i.stack.imgur.com/CbIAg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CbIAg.png" alt="enter image description here"></a></p>
  
  <p>As you can see the API calls for user don't resolve.</p>
  
  <p>This is what the response of <code>user</code> looks like when  online:</p>
  
  <p><a href="https://i.stack.imgur.com/IG3qI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IG3qI.png" alt="enter image description here"></a></p>