aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/cache/shared/api-cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/cache/shared/api-cache.ts')
-rw-r--r--server/middlewares/cache/shared/api-cache.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/middlewares/cache/shared/api-cache.ts b/server/middlewares/cache/shared/api-cache.ts
index c6197b972..b50b7dce4 100644
--- a/server/middlewares/cache/shared/api-cache.ts
+++ b/server/middlewares/cache/shared/api-cache.ts
@@ -35,7 +35,11 @@ export class ApiCache {
35 // Cache keys per group 35 // Cache keys per group
36 private groups: { [groupIndex: string]: string[] } = {} 36 private groups: { [groupIndex: string]: string[] } = {}
37 37
38 private readonly seed: number
39
38 constructor (options: APICacheOptions) { 40 constructor (options: APICacheOptions) {
41 this.seed = new Date().getTime()
42
39 this.options = { 43 this.options = {
40 headerBlacklist: [], 44 headerBlacklist: [],
41 excludeStatus: [], 45 excludeStatus: [],
@@ -88,7 +92,7 @@ export class ApiCache {
88 } 92 }
89 93
90 private getCacheKey (req: express.Request) { 94 private getCacheKey (req: express.Request) {
91 return Redis.Instance.getPrefix() + 'api-cache-' + req.originalUrl 95 return Redis.Instance.getPrefix() + 'api-cache-' + this.seed + '-' + req.originalUrl
92 } 96 }
93 97
94 private shouldCacheResponse (response: express.Response) { 98 private shouldCacheResponse (response: express.Response) {