The offline web has always been problematic. AppCache was a black box of no joy, often causing even the most patient developer to cry out in agony. There must be a better way, somewhere. Enter the Service Worker API.
Service Workers allow event-driven scripts to be run independently of your web page. When all is said and built, the API will let you do things like push notifications and geofencing. In the first version available in Chrome stable and Firefox nightly now, we have the ability to handle network requests and create our own caches.
You can think of this as a network proxy; we can control how our web page requests are handled. We can store requests and use them later. We can become the offline web.
Since we test before we deploy for clients, we’ve actually implemented a basic cache for this production site. In the screenshot below, you can see the production site handling certain requests with Service Worker.
[Service Worker in action]
Want your web applications to go offline? Reach out and send us an email; we can help bring you into the new wave of web applications!