Optional
browserSets the caching behavior in the browser. When set to false
the caching in the browser
is turned off.
Optional
cacheableList of status code which are eligible for caching. Status code 200 is always cached and can't be changed.
Optional
edgeSets 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.
Optional
enableEnables caching for POST and PUT. GET is always cached.
Optional
ignoreEnables caching for requests with cache-control:
private, no-store
or no-cache
header
for specific status codes.
see: https://docs.edg.io/guides/v7/performance/rules/features#ignore-origin-no-cache
Optional
keyAllows 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
}
})
})
Generated using TypeDoc
Options for controlling caching behavior in the browser and at the network edge.