Edit this page

up.network up.cache.expire([pattern])
JavaScript function

Expires entries in the cache.

Expired entries remain in the cache, but will be revalidated after rendering.

By default, Unpoly automatically expires the entire cache whenever it processes a request with a non-GET HTTP method. To customize this rule, use up.network.config.expireCache.

The server may also expire cache entries by sending an X-Up-Expire-Cache header.

Example

Calling without argument will mark the entire cache as expired:

up.cache.expire()

To only expire some cache entries, pass a URL pattern:

up.cache.expire('/users/*')

Parameters

[pattern]
optional

A URL pattern matching cache entries that should be expired.

If omitted, the entire cache is expired.

string