2

I have an app running as pwa built on angular 6, Now I need to exclude some api calls serving from service worker. These are the api calls i need to exclude

https://example.net/api/firstApi?param1=true&param2=no
https://example.net/api/secondApi?param1=true&param2=no

I tried putting ! in front of the urls, still its serving from service worker only.

enter image description here

Below is my config file

{
  "index": "/index.html",
  "dataGroups": [
    {
      "name": "api",
      "urls": [
        "!/**/api/firstApi/**",
        "!/**/api/secondApi/**"
      ],
      "cacheConfig": {
        "maxSize": 0,
        "maxAge": "0u",
        "strategy": "freshness"
      }
    }
  ],
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/*.css",
          "/*.js"
        ]
      }
    }
  ]
}

Thanks in advance!

Prats
  • 1,745
  • 4
  • 24
  • 28

0 Answers0