It's online. It's offline. It's a Service Worker!
Перейти к файлу
Jez McKean b3d7788d44 grammar fix 2019-08-11 12:36:57 +02:00
_recipe_template Adding common assets for offline strategies recipes 2016-09-19 17:38:58 +02:00
api-analytics Use ellipsis character instead of three points 2015-12-28 13:23:35 +01:00
cache-from-zip zip cache use case: grammar fix 2017-03-20 14:53:53 -04:00
cache-then-network Use // comments in Cache then Network (#309) 2018-07-23 16:17:20 +02:00
dependency-injector Update eslint-config-airbnb to version 4 2016-01-23 12:23:47 +00:00
fetching Relying on html client rectangle for determining the iframe size 2016-09-17 18:01:25 +02:00
imgs/random Adding common assets for offline strategies recipes 2016-09-19 17:38:58 +02:00
immediate-claim fix typo 2016-03-01 14:10:42 +01:00
json-cache README cleanup for consistency 2015-12-08 11:39:04 -06:00
live-flowchart Updating screenshot URLs 2016-02-22 17:58:35 +01:00
load-balancer Clarifying how to use the demo 2015-12-11 18:37:22 +01:00
local-download update ui 2018-03-26 18:48:07 -04:00
message-relay Removed more warnings. 2017-02-27 14:39:20 +01:00
offline-fallback README cleanup for consistency 2015-12-08 11:39:04 -06:00
offline-status README cleanup for consistency 2015-12-08 11:39:04 -06:00
push-clients Fix push-clients TTL 2018-04-12 22:22:53 +02:00
push-get-payload Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-payload Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-quota Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-replace Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-rich Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-simple Run subscribe only when serviceWorker.ready resolves 2018-04-12 22:20:34 +02:00
push-subscription-management Cleanup push-subscription-management 2018-04-13 02:18:40 +02:00
render-store Add proxy to images as well 2015-12-30 12:57:02 +01:00
request-deferrer Update eslint-config-airbnb to version 4 2016-01-23 12:23:47 +00:00
src Add iOS-specific styles to make scrolling smoother 2018-05-25 00:23:08 +02:00
strategy-cache-and-update Cache and update strategy 2016-10-05 17:57:20 +02:00
strategy-cache-only Cache only strategy 2016-10-05 16:55:08 +02:00
strategy-cache-update-and-refresh Cache, update and refresh strategy 2016-10-05 17:33:27 +02:00
strategy-embedded-fallback Changing the name of the recipe too. 2016-10-13 15:50:37 +02:00
strategy-network-or-cache grammar fix 2019-08-11 12:36:57 +02:00
virtual-server Relying on html client rectangle for determining the iframe size 2016-09-17 18:01:25 +02:00
.eslintignore Add root files to .eslintignore (we don't need them to be 80 char max) 2015-11-26 12:18:59 +00:00
.eslintrc Update eslint-config-airbnb to version 4 2016-01-23 12:23:47 +00:00
.gitignore - First recipes, auto-claim and offline fallback 2015-09-28 17:36:07 -07:00
.travis.yml Drop support for Node 4 2018-02-06 22:10:01 +01:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct (#318) 2019-03-30 16:06:31 +01:00
LICENSE Initial commit 2015-09-22 10:28:47 -07:00
Procfile amend 2015-09-30 14:20:05 -07:00
README.md Fix formatting in README.md (#310) 2018-07-31 14:06:58 +01:00
favicon.ico Favicon 2015-09-29 14:11:10 -07:00
gulpfile.js Merge pull request #294 from slokhorst/push-vapid 2018-03-28 17:11:37 +02:00
package.json Update some dependencies (#319) 2019-04-04 15:20:35 +02:00
parseRecipes.js Adding common assets for offline strategies recipes 2016-09-19 17:38:58 +02:00
server.js Fix #190 - Remove index.html from homepage URL 2016-03-30 09:53:31 -05:00
tools.js Add tools.js, required for Push recipes 2018-03-03 22:32:38 +01:00

README.md

ServiceWorker Cookbook

Build Status dependencies devdependencies

It's online. It's offline. It's a Service Worker!

Service workers are a new technology to aid developers in:

  • creating realistic, reliable offline experiences
  • vastly improving performance when online
  • logically and dynamically caching files for any purpose

The ServiceWorker API, which has recently made its way into Firefox Developer Edition, will change the way web and mobile app developers make their websites fast and functional!

What is in this cookbook?

This cookbook contains dozens of practical, detailed, and working examples of service worker usage. These examples are for developers from beginner to expert and illustrate a number of APIs:

How to contribute

We are always happy to accept contributions! You can follow the process below to start creating a new recipe:

  1. Clone this repository
  2. Execute cd serviceworker-cookbook && npm install
  3. Copy the _recipe_template directory, rename it, and add all recipe code and resources within that new directory
  4. Execute gulp watch to start the server
  5. Navigate to http://localhost:3000 to develop and test your recipe

When it's all done, please submit a pull request to the ServiceWorker Cookbook.

Similar projects & prior art

Attributions

MealKeeper Icon by Shlyapnikova, Creative Commons (Attribution 3.0 Unported)

Attribution of pictures in Caching strategies category can be found at lorempixel.com.