This plugin deep fetches resources during prefetching based on CSS selectors.

** Example **

 import DeepFetchPlugin from '@edgio/prefetch/sw/DeepFetchPlugin'
import { Prefetcher } from '@edgio/prefetch/sw'

new Prefetcher({
plugins: [
new DeepFetchPlugin([
{
selector: 'img.product-main-image,
maxMatches: 1,
as: 'image',
attribute: 'src'
}
])
]
})

Hierarchy

  • default

Implements

  • WorkboxPlugin

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • config: DeepFetchConfig[]

    Returns default

Properties

config: DeepFetchConfig[]

Accessors

  • get htmlConfigs(): DeepFetchHtmlConfig[]
  • Returns DeepFetchHtmlConfig[]

  • get jsonConfigs(): DeepFetchJsonConfig[]
  • Returns DeepFetchJsonConfig[]

Methods

  • WorkboxPlugin method called every time a fetch succeeds.

    Parameters

    • __namedParameters: FetchDidSucceedCallbackParam

    Returns Promise<Response>

Generated using TypeDoc