Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
Link to the deep dive, regenerate TOC (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick authored Mar 29, 2017
1 parent ac7da0e commit 6b9dbd8
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# Service Worker Precache

> Precache specific resources
Service Worker Precache is a module for generating a service worker that
precaches resources. It integrates with your build process. Once configured, it
detects all your static resources (HTML, JavaScript, CSS, images, etc.) and
Expand All @@ -29,6 +27,10 @@ library, which works well when following the App Shell + dynamic content model.
The full documentation is in this README, and the
[getting started guide](GettingStarted.md) provides a quicker jumping off point.

To learn more about the internals of the generated service worker, you can read
[this deep-dive](https://medium.com/@Huxpro/how-does-sw-precache-works-2d99c3d3c725)
by [Huang Xuan](https://twitter.com/Huxpro).


# Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand All @@ -41,7 +43,7 @@ The full documentation is in this README, and the
- [Example](#example)
- [Considerations](#considerations)
- [Command-line interface](#command-line-interface)
- [Runtime Caching](#runtime-caching)
- [Runtime Caching](#runtime-caching)
- [API](#api)
- [Methods](#methods)
- [generate(options, callback)](#generateoptions-callback)
Expand All @@ -68,8 +70,11 @@ The full documentation is in this README, and the
- [templateFilePath [String]](#templatefilepath-string)
- [verbose [boolean]](#verbose-boolean)
- [Wrappers and Starter Kits](#wrappers-and-starter-kits)
- [CLIs](#clis)
- [Starter Kits](#starter-kits)
- [Recipes for writing a custom wrapper](#recipes-for-writing-a-custom-wrapper)
- [Acknowledgements](#acknowledgements)
- [Future of Service Worker tooling](#future-of-service-worker-tooling)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -360,7 +365,7 @@ the entire request URL. As of v5.0.0, it only matches against the URL's

_Default_: not set

#### dynamicUrlToDependencies [Object&#x27e8;String,Array&#x27e8;String&#x27e9;&#x27e9;]
#### dynamicUrlToDependencies [Object&#;String,Array&#;String&#;&#;]
Maps a dynamic URL string to an array of all the files that URL's contents
depend on. E.g., if the contents of `/pages/home` are generated server-side via
the templates `layout.jade` and `home.jade`, then specify `'/pages/home':
Expand All @@ -384,7 +389,7 @@ would always be served from the service worker cache.

_Default_: `true`

#### ignoreUrlParametersMatching [Array&#x27e8;Regex&#x27e9;]
#### ignoreUrlParametersMatching [Array&#;Regex&#;]
`sw-precache` finds matching cache entries by doing a comparison with the full request URL. It's
common for sites to support URL query parameters that don't affect the site's content and should
be effectively ignored for the purposes of cache matching. One example is the
Expand All @@ -395,7 +400,7 @@ To ignore all parameters, use `[/./]`. To take all parameters into account when

_Default_: `[/^utm_/]`

#### importScripts [Array&#x27e8;String&#x27e9;]
#### importScripts [Array&#;String&#;]
Writes calls to [`importScripts()`]
(https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/basic_usage#Importing_scripts_and_libraries)
to the resulting service worker to import the specified scripts.
Expand Down Expand Up @@ -432,7 +437,7 @@ the request is a navigation.

_Default_: `''`

#### navigateFallbackWhitelist [Array&#x27e8;RegExp&#x27e9;]
#### navigateFallbackWhitelist [Array&#;RegExp&#;]
Works to limit the effect of `navigateFallback`, so that the fallback only
applies to requests for URLs with paths that match at least one
[`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp).
Expand Down Expand Up @@ -465,7 +470,7 @@ and replace it with '/public/'.

_Default_: `''`

#### runtimeCaching [Array&#x27e8;Object&#x27e9;]
#### runtimeCaching [Array&#;Object&#;]
Configures runtime caching for dynamic content. If you use this option, the `sw-toolbox`
library configured with the caching strategies you specify will automatically be included in
your generated service worker file.
Expand Down Expand Up @@ -526,7 +531,7 @@ until they're needed at runtime.

_Default_: `true`

#### staticFileGlobs [Array&#x27e8;String&#x27e9;]
#### staticFileGlobs [Array&#;String&#;]
An array of one or more string patterns that will be passed in to
[`glob`](https://github.com/isaacs/node-glob).
All files matching these globs will be automatically precached by the generated service worker.
Expand Down

0 comments on commit 6b9dbd8

Please sign in to comment.