Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DeepFetchConfig

Hierarchy

  • DeepFetchConfig

Index

Properties

as

as: "image" | "script" | "style" | "font" | "fetch" | "video"

The value for the <link rel="prefetch|preload"> element's as attribute. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link. Use "fetch" for html pages as Safari doesn't support "document".

attribute

attribute: string

The attribute whose value should be prefetched. Defaults to src.

Optional callback

callback: undefined | ((param: DeepFetchCallbackParam) => void)

A callback to override the default prefetching logic. Will be called for each matching element, or if maxMatches is provided, the first n elements.

Optional cors

cors: undefined | false | true

Whether the asset is served cross-origin with CORS response headers. A cross-origin request with no CORS response headers can not be processed by the service-worker. If set to false, the asset will be prefetched without being cached by the service-worker. Defaults to true.

Optional maxMatches

maxMatches: undefined | number

The max number of matching elements to prefetch per page

selector

selector: string

The CSS selector to use when finding elements whose src or href should be deep fetched

Generated using TypeDoc