Specifies that requests should be cached on a per-browser basis. This will have no effect on service worker cache.
A self-reference, suitable for chaining.
Adds a cookie to the cache key. This will have no effect on service worker cache.
The name of the cookie
An function that accepts a Groups
instance and calls groups.group(name)
to group multiple values into a single cache key component
A self-reference, suitable for chaining.
Specifies that requests should be cached on a per-device basis. This will have no effect on service worker cache.
A self-reference, suitable for chaining.
Adds a request header to the cache key. This will have no effect on service worker cache.
The name of the request header
A function that accepts a Groups
instance and calls groups.group(name)
to group multiple values into a single cache key component
A self-reference, suitable for chaining.
Specifies that requests should be cached differently for bots. This will have no effect on service worker cache.
A self-reference, suitable for chaining.
Specifies that requests should be cached on a per-vendor basis. This will have no effect on service worker cache.
A self-reference, suitable for chaining.
Creates a copy of the cache key.
Excludes the entire query string from the cache key.
A self-reference, suitable for chaining.
Excludes all query parameters except those provided from the cache key. We also refer to
this as "whitelisting" query parameters. We recommend using this method over excludeQueryParameters
as it's difficult to know all of the query parameters your application might receive and unexpected
query parameters can lead to significantly lower cache hit rates.
The names of the query parameters to whitelist
A self-reference, suitable for chaining.
Excludes the provided query parameters from the cache key. All other parameters will still be part of the cache key. We also refer to this as "blacklisting" query parameters.
The names of the query parameters to blacklist
A self-reference, suitable for chaining.
Removes the HTTP body from the cache key.
A self-reference, suitable for chaining.
Removes the HTTP method from the cache key.
A self-reference, suitable for chaining.
Generated using TypeDoc
Allows you to split or normalize the cache space for a given route. Common use cases include:
Example
import { Router, CustomCacheKey } from '@edgio/core/router' new Router() .match('/some-path', ({ cache }) => { cache({ key: new CustomCacheKey() .excludeAllQueryParametersExcept('color', 'size') .addCookie('currency') .addCookie('location', cookie => { cookie.group('na').byPattern('us|ca') cookie.group('eur').byPattern('de|fr|ee') }), edge: { maxAgeSeconds: 60 * 60 } }) })