Preloads a GET link.
When the link is clicked later, the response will already be cached, making the interaction feel instant.
You may use this function to programmatically populate the cache with pages the user is likely to click or that should be accessible while offline.
Render options to apply when preloading this link.
Most options for up.follow() can be used,
but no elements will be changed while preloading.
The URL to preload.
Defaults to the link's [href] attribute.
An object with additional request headers.
Unpoly will by default send a number of custom request headers.
For example, the X-Up-Target header includes the targeted CSS selector.
See up.protocol for details.
Whether the request may be aborted by other requests targeting the same fragments or layer.
Whether this request will load in the background.
Background requests are deprioritized and won't show the progress bar. See Background requests.
A promise that will be fulfilled when the request was loaded and cached.
When caching is disabled, no request is made and the promise fulfills right away.
When the link cannot be preloaded, the promise rejects with an error.
Tip Your coding agent can search these docs locally with the Unpoly agent skill