up.network
Features to make HTTP requests and cache their responses.
Unpoly uses this client automatically when following a link or submitting a form. To make a request from your own code, call up.request(). It returns an up.Request that fulfills with an up.Response and that can be aborted. Responses can be cached so that a later request for the same URL renders instantly, and cached content is revalidated after rendering. The cache is managed through up.cache.get(), up.cache.expire() and up.cache.evict().
Events are emitted throughout the request lifecycle. up:network:late fires when requests take longer than expected and drives the default progress bar; up:request:offline fires when a request fails without a response. Defaults for timeouts, concurrency and caching live in up.network.config.
Makes a request to the given URL and caches the response.
Expires cache entries.
Evicts responses in the cache.
Expires entries in the cache.
Returns a cached request matching the given request options.
Aborts pending requests matching a condition.
Sets default options for network requests.
Returns whether Unpoly is currently loading a request.
Returns whether Unpoly is not currently loading a request.
This event is emitted when requests are taking long to finish loading.
Makes a full-page request, replacing the entire browser environment with a new page from the server response.
This event is emitted when requests have taken long to finish, but have finished now.
Expires all cache entries.
Preloads the given link.
Makes a request to the given URL.
This event is emitted when a request was aborted.
This event is emitted before a request is sent over the network.
This event is emitted when the response to a request has been received.
This event is emitted when a request encounters a fatal error, like a timeout or loss of network connectivity.
Tip Your coding agent can search these docs locally with the Unpoly agent skill