Sets the caching behavior in the browser. When set to false
the caching in the browser
is turned off.
Sets the caching behavior at edge. When set to false
the caching in the edge is turned
off. This also turns off queueing of potentially cacheable requests that platform performs
automatically.
Note: if know for sure that a specific GET
route will never cache then you should
always set edge
caching to false
for it as it will disable GET
request coalescing
making your application faster.
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
}
})
})
If true, prefetch requests that match the route pattern will not be cached directly,
but will instead force the Prefetcher to prefetch paths listed in the response's
x-0-upstream-requests
header.
Generated using TypeDoc
Options for controlling caching behavior in the browser and at the network edge.