The Edgio hostname from which to prefetch cached content. This is only used when the origin site is not served from Edgio.
The probability that a prefetch request will be relayed to the origin even if a response is not in the cache. Defaults to 0. This should be a number between 0 and 1.
Set to true to include pages not in the edge cache when prefetching. By default
pages will only be prefetched if they are available in Edgio edge cache. Warning:
setting this to true
will cause a significant increase in traffic to the origin server.
The prefetcher observes the DOM for new elements that are added for potential
prefetching. Observations are made to the document's child nodes and subtree.
Attributes changes are not observed by default, but can be enabled with
ObserveOptionsConfig.attributes
. Additionally, you can disable the observer
by setting ObserveOptionsConfig.disabled
to true
.
Any link whose href matches one of these patterns will have its href prefetched when the link becomes visible
URLs to prefetch immediately
The URL path on which the service worker is served.
A list of config objects with selectors to watch for. When elements matching the selector are found, the specified callback is called.
Example
install({
watch: [{
selector: 'div.product-tile',
callback: el => {
const productId = el.getAttribute('data-product-id')
const catId = document.getElementById('cat-listing').getAttribute('data-category-id')
prefetch(/api/${catId}/${productId}
, 'fetch')
}
}]
})
Generated using TypeDoc
Options for the
install
function.