PrefetchConfiguration: {
    cors?: false | "anonymous" | "use-credentials";
    forcePrefetchRatio?: number;
    includeCacheMisses?: boolean;
    maxAgeSeconds?: number;
}

Object with configuration for prefetch function

Type declaration

  • Optional cors?: false | "anonymous" | "use-credentials"

    Allows to change default CORS policy of prefetch request. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin

  • Optional forcePrefetchRatio?: number

    Allows to override the default forcePrefetchRatio value from install() function. The number represents ratio of requests that are sent to origin even when they are not in the Edge cache. Possible values: Number between 0 and 1. Number 0 is equal to 0% requests and 1 to 100% requests sent to origin.

  • Optional includeCacheMisses?: boolean

    Allows to override the default includeCacheMisses value from install() function. Set to true to send all requests to origin even when they are not in the Edge cache.

  • Optional maxAgeSeconds?: number

    Allows to override the default Prefetch TTL or serviceWorkerSeconds value defined in routes.js. The number represents the seconds for how long the item will be stored in the browser cache.

Generated using TypeDoc