Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • DeepFetchPlugin

Implements

  • WorkboxPlugin

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

config

config: DeepFetchConfig[]

Accessors

htmlConfigs

jsonConfigs

Methods

fetchDidSucceed

  • fetchDidSucceed(__namedParameters: { request: Request; response: Response }): Promise<Response>
  • WorkboxPlugin method called every time a fetch succeeds.

    Parameters

    • __namedParameters: { request: Request; response: Response }
      • request: Request
      • response: Response

    Returns Promise<Response>

Generated using TypeDoc