Edit this page

up.link up.link.preload(link, options, [options])
JavaScript function

Preloads the given 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 requires accessible while offline.


Parameters

options Object

See options for up.follow().

[options.abortable=false] boolean optional experimental

Whether the preload request may be aborted when the user navigates or when up.fragment.abort() is called.

Return value

A promise that will be fulfilled when the request was loaded and cached.

When the link cannot be preloaded, the promise rejects with an up.AbortError.