Skip to main content
Module

x/prefetch/mod.ts>Options

A Fresh plugin for prefetching pages
Latest
interface Options
import { type Options } from "https://deno.land/x/prefetch@0.1.0/mod.ts";

Properties

optional
priority: boolean

Attempt higher priority fetch (low or high)

optional
origins: string[]

Allowed origins to prefetch (empty allows all)

optional
timeout: number

Timeout after which prefetching will occur

optional
throttle: number

The concurrency limit for prefetching

optional
threshold: number

The area percentage of each link that must have entered the viewport to be fetched

optional
limit: number

The total number of prefetches to allow

optional
delay: number

Time each link needs to stay inside viewport before prefetching (milliseconds)

optional
prerender: boolean

Option to switch from prefetching and use prerendering only

optional
prerenderAndPrefetch: boolean

Option to use both prerendering and prefetching

optional
strategy: "opt-in" | "opt-out"

Strategy to prefetch.

set opt-in to prefetch only anchor tags containing the data-prefetch attribute set opt-out to ignore only those links with the data-noprefetch attribute set aggresive to prefetch all links