API reference up.network
module

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.


Features