Preloads this link before the user clicks it. When the link is clicked, the response will already be cached, making the interaction feel instant.
Unpoly will only preload links with safe methods. The [up-preload]
attribute
has no effect on unsafe links.
Links with the [up-preload]
attribute are always followed by Unpoly and will not make a full page load.
<a href="/path" up-preload>Hover over me to preload my content</a>
Info
All modifying attributes for
[up-follow]
may also be used.
When to preload this link.
When set to 'hover'
(the default), preloading will start when the user hovers
over this link for a while. On touch devices preloading will
begin when the user places her finger on the link. Also see preloading on hover.
When set to 'insert'
, preloading will start immediately when this
link is inserted into the DOM. Also see eagerly preloading on insertion.
When set to 'reveal'
, preloading will start when the link is scrolled
into the viewport. If the link is already visible when
inserted, preloading will start immediately. Also see preloading when a link becomes visible.
When set to 'false'
, the link will not be preloaded.
You can still preload this link programmatically using up.link.preload()
.
[up-preload="hover"]
, this requires the user to hover
for the given number of milliseconds before the link is preloaded.
Defaults to up.link.config.preloadDelay
.
With [up-preload=reveal]
, this enlarges the viewport by the given number of pixels before
computing the intersection.
A positive number will load the deferred content some pixels before it becomes visible.
A negative number will require the user to scroll some pixels into the element before it is loaded.
The URL to preload.
A relaxed JSON object with additional request headers.
Unpoly will by default send a number of custom request headers.
E.g. the X-Up-Target
header includes the target selector.
See up.protocol
for details.
Whether this request will load in the background.
Background requests deprioritized over foreground requests.
Background requests also won't emit up:network:late
events and won't trigger
the progress bar.
Whether this request may be aborted by other requests targeting the same fragments or layer.
See aborting requests for details.