{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/100","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/100/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/100/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/100","id":120660409,"number":100,"title":"Support offline access + caching using Service Workers","user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars.githubusercontent.com/u/71047?v=3","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-12-06T21:20:28Z","updated_at":"2016-05-14T04:18:14Z","closed_at":null,"body":"https://medium.com/google-developers/instant-loading-web-apps-with-an-application-shell-architecture-7c0c2f10c73#.d8r14ktfw\r\n\r\nIt'd would be *really* cool if Gatsby could support this architecture by default. Service workers are supported by ~50% of browsers now and this would make the initial paint instant for Gatsby sites on subsequent loads.\r\n\r\nNot 100% sure how this would work though. It'd be a great research project if someone wants to investigate.\r\n\r\nSome more readings:\r\n\r\n* http://www.html5rocks.com/en/tutorials/service-worker/introduction/\r\n* https://github.com/markdalgleish/serviceworker-loader\r\n* [Example application shell app written with React.js + React-Router](https://github.com/GoogleChrome/sw-precache/tree/app-shell-demo/app-shell-demo)\r\n* http://addyosmani.com/blog/getting-started-with-progressive-web-apps/\r\n* [Screencast intro to service working caching](https://www.youtube.com/watch?v=CJl1BtrlAZY)\r\n* https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md\r\n* https://github.com/GoogleChrome/sw-toolbox\r\n* PR adding SW support https://github.com/insin/react-hn/commit/f33eee3ae98905ca83d2d0be29fd09ad88d12cab\r\n* https://medium.com/@boopathi/service-workers-gotchas-44bec65eab3f#.67rbcd1mo"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/219199618","html_url":"https://github.com/gatsbyjs/gatsby/issues/100#issuecomment-219199618","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/100","id":219199618,"user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars.githubusercontent.com/u/71047?v=3","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T04:18:14Z","updated_at":"2016-05-14T04:18:14Z","body":"So interesting thought I just had hear. One way to use Service Workers + code splitting is that every page has a separate bundle. But then when creating the service-worker file, we first analyze the link structure of the site so that whatever page you land on, you initially load just that pages JS bundle but then the service worker async loads and caches the bundle for every page that page links to. So clicking around the site should be very fast with resources prefetched but the initial fetching remains as small/fast as possible. This could be configurable so say if the user is on a mobile network, you don't prefetch.\r\n\r\nRelevant https://twitter.com/slightlylate/status/731203821335023616"}}