{"action":"created","issue":{"url":"https://api.github.com/repos/Polymer/docs/issues/1641","repository_url":"https://api.github.com/repos/Polymer/docs","labels_url":"https://api.github.com/repos/Polymer/docs/issues/1641/labels{/name}","comments_url":"https://api.github.com/repos/Polymer/docs/issues/1641/comments","events_url":"https://api.github.com/repos/Polymer/docs/issues/1641/events","html_url":"https://github.com/Polymer/docs/pull/1641","id":158242124,"number":1641,"title":"Add a service worker","user":{"login":"notwaldorf","id":1369170,"avatar_url":"https://avatars.githubusercontent.com/u/1369170?v=3","gravatar_id":"","url":"https://api.github.com/users/notwaldorf","html_url":"https://github.com/notwaldorf","followers_url":"https://api.github.com/users/notwaldorf/followers","following_url":"https://api.github.com/users/notwaldorf/following{/other_user}","gists_url":"https://api.github.com/users/notwaldorf/gists{/gist_id}","starred_url":"https://api.github.com/users/notwaldorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notwaldorf/subscriptions","organizations_url":"https://api.github.com/users/notwaldorf/orgs","repos_url":"https://api.github.com/users/notwaldorf/repos","events_url":"https://api.github.com/users/notwaldorf/events{/privacy}","received_events_url":"https://api.github.com/users/notwaldorf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Polymer/docs/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2016-06-02T21:18:32Z","updated_at":"2016-08-19T16:41:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Polymer/docs/pulls/1641","html_url":"https://github.com/Polymer/docs/pull/1641","diff_url":"https://github.com/Polymer/docs/pull/1641.diff","patch_url":"https://github.com/Polymer/docs/pull/1641.patch"},"body":"I thiiiink this should work? \r\n- precaching the elements, the css/js and the main page. Total precache size is about 391.02 kB for 8 resources.\r\n- everything else should be runtime caching. I didn't know how to precache some images (the ones used by the landing page), but runtime cache the other ones (since they're on the same path) so I chose to do runtime caching for everything instead :/\r\n\r\nCurrent outstanding problem, not really on us, but we might be able to fix it with a `dom-if` and the network behaviour:\r\nWhen offline, there is one problem with the youtube iframe (from `google-youtube`), which seems to panic and make a billion of these requests:\r\n<img width=\"885\" alt=\"screen shot 2016-06-02 at 11 03 57 am\" src=\"https://cloud.githubusercontent.com/assets/1369170/15761437/060fe0a4-28cd-11e6-91c2-3ae34e0d17ca.png\">\r\n\r\nSince the iframe is not in the same scope as the SW, we can't really do anything to help it (and we are not causing it)\r\n\r\nR: @ebidel, @jeffposnick as an fyi since he's a 💎 and helped me with most of this anyway."},"comment":{"url":"https://api.github.com/repos/Polymer/docs/issues/comments/241069257","html_url":"https://github.com/Polymer/docs/pull/1641#issuecomment-241069257","issue_url":"https://api.github.com/repos/Polymer/docs/issues/1641","id":241069257,"user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T16:41:30Z","updated_at":"2016-08-19T16:41:30Z","body":"@notwaldorf: I think things are looking good! 🎆  The issues mentioned in https://github.com/Polymer/docs/pull/1641#issuecomment-225253917 seem to be fixed by the move to `sw-precache` 4.0.0.\r\n\r\nI left two smallish comments about the `sw-precache` config.\r\n\r\nRegarding making direct changes to `index.html`, because it's one of the files that's precache by `sw-precache` during the build step, you need to re-run the `generate-service-worker` task in order to get the service worker to pick up those changes. After regenerating the service worker, the next time you go to `index.html` you'll see a toast indicating that something's been updated. Then, if you follow the toast's directions and reload, or navigate to the page again, you'll see the newest content.\r\n\r\nOne of the things to think about prior to rolling this out is making sure that there's a strategy in place to roll it back in case anything goes wrong 😄 . To that end, [this Stack Overflow answer](https://stackoverflow.com/questions/33986976/how-can-i-remove-a-buggy-service-worker-or-implement-a-kill-switch/38980776#38980776) covers some things to think about, and a strategy for dealing with reverting a \"bad\" service worker deployment."}}
{"actor":{"display_login":"jeffposnick"}}