Search


Search something to see results

SwChangeDetectionConfig

Configures the change detection Speed Kit's Service Worker runs on its own.

Pass true instead to switch revalidation on, or false to turn the detection off entirely.

interface SwChangeDetectionConfig {
    ignore?: SpeedKitRule[];
    reportOnly?: boolean;
}

Index

Properties

Properties

ignore?: SpeedKitRule[]

Pages to leave out of the change detection.

Use this where a redirect is expected and says nothing about the cached page being out of date. A shop that sends visitors from the landing page to their local store, for example, redirects every time the store cookie is set, and there is nothing to revalidate.

swChangeDetection: {
ignore: [{ pathname: '/', cookie: { selectedStore: /.+/ } }],
}

A rule matches anywhere a redirect touches, not only the page it starts on, so a known target like { pathname: '/login' } excludes every redirect leading there.

2.22.4

reportOnly?: boolean

Only reports what the Service Worker finds instead of revalidating.

While this is on, a finding is written to the changeReport beacon and no cached page is dropped, so the detection can be judged before it is allowed to invalidate anything.

true

2.22.4