Automatically activate newly registered service workers (skipWaiting()). When false, the SW activates on next navigation or browser reload — no user prompt.
Number of assets to download simultaneously during background precaching. Higher values (e.g. 5) speed up large precaches but may increase bandwidth contention. All assets (build output, fallback routes, per-route fallbacks, manifest) are cached in the background after activation — nothing is cached during the install event.
delayMs
number
0
Delay in milliseconds between starting individual asset requests within a batch. Spaces out requests to avoid network saturation.
Default caching strategy (lowest priority in 3-tier resolution). One of: cache-first, network-first, stale-while-revalidate, cache-only, network-only, reactive
patterns
object
{}
Per-route strategy overrides. Keys are URL patterns (e.g. /api/*). Values can be a strategy name string or a StrategyEntry object. Set to "network-only" for routes you want to pass through to the network entirely — useful when using in-memory caching libraries for data routes while keeping offline capability everywhere else.
reactive.staleTime
number
0
Global stale time in seconds for reactive strategy. Data is considered fresh for this long; after expiry, SW serves cached but triggers a background refresh. 0 = always stale.
reactive.refetchInterval
number
0
Global auto-refetch interval in seconds for reactive strategy. SW periodically re-fetches matching routes in the background. 0 disables.
reactive.refetchOnReconnect
boolean
false
Global default — refetch reactive entries when the browser comes back online
reactive.refetchOnFocus
boolean
false
Global default — refetch reactive entries when the tab gains focus
maxRuntimeCacheAge
number
2592000
Maximum age in seconds for runtime cache entries. 0 disables eviction. Default 2592000 (30 days).
normalizeKey
boolean
false
When true, query params are sorted alphabetically in cache keys so ?b=1&a=2 and ?a=2&b=1 resolve to the same entry.
ignoreQueryParams
string[]
[]
Query params to strip from cache keys (e.g. ["_t", "utm_source"]). Prevents cache-busting params from creating duplicate cache entries.
timeout
number
10
Network fetch timeout in seconds. The SW's _fetch wraps fetch() with an AbortController that aborts after this duration. On timeout or network error, a SW_NOTIFICATION is broadcast (level: "error", code: "FETCH_FAILED"), and the strategy falls through to its cache fallback.
storageThreshold
number
80
Storage quota warning threshold (percent). When navigator.storage.estimate().percentUsed exceeds this value after SW init, a STORAGE_QUOTA_HIGH notification is dispatched. Range: 0–100.
Navigation mode. "spa": serves global fallback directly from serveFromCache() (no runtime HTML caching). "default": no special navigation handling — strategies handle all requests equally. "ssr": checks HTML cache → per-route fallback → global fallback via navFallback(); adds auto-prefetch that intercepts history.pushState/replaceState to warm the SW cache on client-side navigation. Non-navigation subresources (JS, CSS, images, API) return 502 Bad Gateway instead of entering the HTML fallback chain.
preload
boolean
true
Enable Navigation Preload API — reduces SW startup latency
fallback
string
""
Global fallback HTML path for offline navigation. For SPA mode, set to "/index.html" to serve the SPA shell from precache when offline. For SSR mode, checked by navFallback() after per-route rules if the runtime HTML cache misses.
precacheRoutes
string[]
[]
Additional routes to precache in the background after activation (e.g. ["/", "/about"]). Useful for SSG or critical pages — cached alongside scanned build assets.
rules
NavigationRule[]
[]
Per-route offline fallback pages (see below). Rules provide the fallback path used by navFallback() when strategy dispatch fails; they do not override the caching strategy. Navigation-only — non-subresource requests skip the rule check and return 502.
Stale time in seconds. Reactive-only — only valid when strategy is "reactive". Data is considered fresh for this long; after expiry, SW serves cached but triggers a background refresh. 0 = always stale.
refetchInterval
number
—
Auto-refetch interval in seconds. Reactive-only. The SW periodically re-fetches this route in the background. 0 disables.
refetchOnReconnect
boolean
false
Refetch when the browser comes back online. Reactive-only.
refetchOnFocus
boolean
false
Refetch when the browser tab gains focus. Reactive-only.
timeout
number
—
Override the global fetch timeout for this specific pattern (in seconds).