angular / mobile-toolkit

Tools for building progressive web apps with Angular
MIT License
1.34k stars 175 forks source link

Dynamic content from API #185

Open felek000 opened 7 years ago

felek000 commented 7 years ago

Hello i want to configure my PWA app. My app works fine except dynamic content api. When online it working fine but when i go offline i get status 503 from serviceWorker. My config file: ngsw-manifest.json any adicional config needed here ?

{
  "dynamic": {
    "group": [{
      "name": "api",
      "urls": {
        "URLCALL": {
          "match": "prefix"
        }
      },
      "cache": {
        "optimizeFor": "freshness",
        "maxAgeMs": 3600000,
        "maxEntries": 20,
        "strategy": "lru"
      }
    }]
  },
  "external": {
    "urls": [{
      "url": "https://fonts.googleapis.com/icon?family=Material+Icons"
    }]
  }
}
webmaxru commented 7 years ago

Most likely this is "freshness" strategy issue described here: https://github.com/angular/mobile-toolkit/issues/168