mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 12:03:03 +00:00
Refactor to two caches. One for bots and one for anonymous users
This commit is contained in:
@@ -76,10 +76,22 @@ export class DefaultAppConfig implements AppConfig {
|
||||
},
|
||||
// In-memory cache of server-side rendered content
|
||||
serverSide: {
|
||||
// Maximum number of pages (rendered via SSR) to cache. Set to zero to disable server side caching.
|
||||
max: 100,
|
||||
// Amount of time after which cached pages are considered stale (in ms)
|
||||
timeToLive: 15 * 60 * 1000 // 15 minutes
|
||||
// Cache specific to known bots. Allows you to serve cached contents to bots only.
|
||||
// Defaults to caching 1,000 pages. Each page expires after 1 day
|
||||
botCache: {
|
||||
// Maximum number of pages (rendered via SSR) to cache. Setting max=0 disables the cache.
|
||||
max: 1000,
|
||||
// Amount of time after which cached pages are considered stale (in ms)
|
||||
timeToLive: 24 * 60 * 60 * 1000, // 1 day
|
||||
},
|
||||
// Cache specific to anonymous users. Allows you to serve cached content to non-authenticated users.
|
||||
// Defaults to caching 0 pages. But, when enabled, each page expires after 10 seconds (to minimize anonymous users seeing out-of-date content)
|
||||
anonymousCache: {
|
||||
// Maximum number of pages (rendered via SSR) to cache. Setting max=0 disables the cache.
|
||||
max: 0, // disabled by default
|
||||
// Amount of time after which cached pages are considered stale (in ms)
|
||||
timeToLive: 10 * 1000, // 10 seconds
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user