payload: {"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/31480","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/31480/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/31480/comments","events_url":"https://api.github.com/repos/angular/angular/issues/31480/events","html_url":"https://github.com/angular/angular/issues/31480","id":466040635,"node_id":"MDU6SXNzdWU0NjYwNDA2MzU=","number":31480,"title":"Service worker performance strategy makes network request to ngsw.json for dataGroups","user":{"login":"Exocomp","id":25571083,"node_id":"MDQ6VXNlcjI1NTcxMDgz","avatar_url":"https://avatars3.githubusercontent.com/u/25571083?v=4","gravatar_id":"","url":"https://api.github.com/users/Exocomp","html_url":"https://github.com/Exocomp","followers_url":"https://api.github.com/users/Exocomp/followers","following_url":"https://api.github.com/users/Exocomp/following{/other_user}","gists_url":"https://api.github.com/users/Exocomp/gists{/gist_id}","starred_url":"https://api.github.com/users/Exocomp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exocomp/subscriptions","organizations_url":"https://api.github.com/users/Exocomp/orgs","repos_url":"https://api.github.com/users/Exocomp/repos","events_url":"https://api.github.com/users/Exocomp/events{/privacy}","received_events_url":"https://api.github.com/users/Exocomp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-07-10T00:29:24Z","updated_at":"2019-07-11T19:29:50Z","closed_at":"2019-07-10T11:34:24Z","author_association":"NONE","body":"### Description\r\n\r\nAngular Service Worker configured with dataGroups cacheConfig performance strategy makes a network call to ngsw.json after serving the resource.\r\n\r\nSteps to reproduce:\r\n\r\n1) Configure ngsw-config.json with the following settings:\r\n\r\n```\r\n\"dataGroups\": [\r\n\t{\r\n\t\t\"name\": \"photos\",\r\n\t\t\"urls\": [\r\n\t\t\t\"/photo/**\"\r\n\t\t],\r\n\t\t\"cacheConfig\": {\r\n\t\t\t\"strategy\": \"performance\",\r\n\t\t\t\"maxSize\": 1000,\r\n\t\t\t\"maxAge\": \"7d\"\r\n\t\t}\r\n\t}\r\n]\r\n```\r\n\r\n2) Browse to your Angular page that has a image to http://hostname/photo/unqiue_photo.png\r\n3) The service worker should cache page and the photo\r\n4) Open another tab and copy and paste directly to http://hostname/photo/unqiue_photo.png\r\n5) The browser shows that the image was retrieved from service worker, however, a couple seconds later service worker makes a network call to \"/ngsw.json?ngsw-cache-bust=0.5564537918108132\"\r\n\r\n**Expectation**: Since the request is part of the \"dataGroups\" it will not be in ngsw.json so I don't see a point to make a call to \"ngsw.json\".  Also note that the strategy is \"performance\".  So my expectation was no network call would be made.  Documentation states that no network call will be made for strategy \"performance\" until expiration time specified by maxAge.\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\n<pre><code>\r\nAngular CLI: 8.1.0\r\nNode: 10.13.0\r\nOS: win32 x64\r\nAngular: 8.1.0\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... platform-server, router, service-worker\r\n\r\nPackage                                    Version\r\n--------------------------------------------------------------------\r\n@angular-devkit/architect                  0.801.0\r\n@angular-devkit/build-angular              0.801.0\r\n@angular-devkit/build-optimizer            0.801.0\r\n@angular-devkit/build-webpack              0.801.0\r\n@angular-devkit/core                       8.1.0\r\n@angular-devkit/schematics                 8.1.0\r\n@angular/cdk                               8.0.2\r\n@angular/http                              7.2.15\r\n@angular/material                          8.0.2\r\n@angular/pwa                               0.801.0\r\n@ngtools/webpack                           8.1.0\r\n@nguniversal/module-map-ngfactory-loader   7.1.1\r\n@schematics/angular                        8.1.0\r\n@schematics/update                         0.801.0\r\nrxjs                                       6.5.2\r\ntypescript                                 3.4.5\r\nwebpack                                    4.35.2\r\n</code></pre>\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/510622494","html_url":"https://github.com/angular/angular/issues/31480#issuecomment-510622494","issue_url":"https://api.github.com/repos/angular/angular/issues/31480","id":510622494,"node_id":"MDEyOklzc3VlQ29tbWVudDUxMDYyMjQ5NA==","user":{"login":"gkalpak","id":8604205,"node_id":"MDQ6VXNlcjg2MDQyMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/8604205?v=4","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"created_at":"2019-07-11T19:29:50Z","updated_at":"2019-07-11T19:29:50Z","author_association":"MEMBER","body":"I am afraid I don't know how to better explain this 😞\r\n\r\nWhat you describe on step 4 is a navigation request (see [Request.mode: navigate][1]): The browser \"navigates\" to a URL, which involves requesting a document from the server (or the service worker for that matter). The fact that the URL maps to a document that is an image and not an HTML document is irrelevant.\r\n\r\nBy design, on every navigation request, a \"check for app updates\" is scheduled (for when the SW is idle). I understand that (for some specific usecase) checks might be too often, but for the vast majority of usecases (involving a SW) the overhead will be minimal (very few navigation requests compared to other types of requests and very small payload of `ngsw.json` compared to other fetched resources/data).\r\n\r\n##\r\nEvery design desicion will inevitably leave someone unsatisfied and there is only so much you can do (especially since the Angular SW is intentionally opinionated and unflexible for the time being) 🤷‍♂\r\n\r\nFeel free to open a feature request for either reducing the frequency of update checks (e.g. not check if last check was less than X amount of time ago) or disabling the automatic update checks (although I would not be keen on introducing this option :grin:).\r\n\r\n[1]: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode"}}
other: {"actor":{"display_login":"gkalpak"}}