Add "debug" config and "allowStale" configs

This commit is contained in:
Tim Donohue
2023-02-07 12:22:32 -06:00
parent a150c64e2f
commit c099bc468d
5 changed files with 33 additions and 6 deletions

View File

@@ -11,12 +11,16 @@ export interface CacheConfig extends Config {
// In-memory caches of server-side rendered (SSR) content. These caches can be used to limit the frequency
// of re-generating SSR pages to improve performance.
serverSide: {
// Debug server-side caching. Set to true to see cache hits/misses/refreshes in console logs.
debug: boolean,
// Cache specific to known bots. Allows you to serve cached contents to bots only.
botCache: {
// Maximum number of pages (rendered via SSR) to cache. Setting max=0 disables the cache.
max: number;
// Amount of time after which cached pages are considered stale (in ms)
timeToLive: number;
// true = return page from cache after timeToLive expires. false = return a fresh page after timeToLive expires
allowStale: boolean;
},
// Cache specific to anonymous users. Allows you to serve cached content to non-authenticated users.
anonymousCache: {
@@ -24,6 +28,8 @@ export interface CacheConfig extends Config {
max: number;
// Amount of time after which cached pages are considered stale (in ms)
timeToLive: number;
// true = return page from cache after timeToLive expires. false = return a fresh page after timeToLive expires
allowStale: boolean;
}
}
}