M Fahad
M Fahad

Reputation: 35

angular service worker caching every request no matter what even i'm hard reloading still it caching every request which not even in config urls

why my every request is being cached when even did't mentioned anything about whose api address to get cached, It seems like the ngsw-worker.js is not following the ngsw.json configs

image 1 => here is the first image of api which is everytime being cached from service worker even though its not inn the config file

image 2 => here is the list of apis which all got response from the service worker even without having in configs to get cached

{
"index": "/index.html",
"assetGroups": [
  {
    "name": "app",
    "installMode": "prefetch",
    "resources": {
      "files": [
        "/favicon.ico",
        "/index.html",
        "/manifest.webmanifest",
        "/*.css",
        "/*.js"
      ]
    }
  },
  {
    "name": "assets",
    "installMode": "lazy",
    "updateMode": "prefetch",
    "resources": {
      "files": [
        "/assets/**",
        "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
      ]
    }
  }
],
"dataGroups": [
 
  {
    "name": "api-freshness",
    "urls": [
      "/keycloak.json",
      "/api/user-config/**",
      "/applications/**",
      "/api/services"
    ],
    "cacheConfig": {
        "strategy": "freshness",
        "maxSize": 1000,
        "maxAge": "1d",
        "timeout": "1s"
    }
  }
]

}

Upvotes: 0

Views: 657

Answers (0)

Related Questions