aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/cache/cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/cache/cache.ts')
-rw-r--r--server/middlewares/cache/cache.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/server/middlewares/cache/cache.ts b/server/middlewares/cache/cache.ts
index e14160ba8..6041c76c3 100644
--- a/server/middlewares/cache/cache.ts
+++ b/server/middlewares/cache/cache.ts
@@ -17,12 +17,22 @@ function cacheRoute (duration: string) {
17function cacheRouteFactory (options: APICacheOptions) { 17function cacheRouteFactory (options: APICacheOptions) {
18 const instance = new ApiCache({ ...defaultOptions, ...options }) 18 const instance = new ApiCache({ ...defaultOptions, ...options })
19 19
20 return instance.buildMiddleware.bind(instance) 20 return { instance, middleware: instance.buildMiddleware.bind(instance) }
21}
22
23// ---------------------------------------------------------------------------
24
25function buildPodcastGroupsCache (options: {
26 channelId: number
27}) {
28 return 'podcast-feed-' + options.channelId
21} 29}
22 30
23// --------------------------------------------------------------------------- 31// ---------------------------------------------------------------------------
24 32
25export { 33export {
26 cacheRoute, 34 cacheRoute,
27 cacheRouteFactory 35 cacheRouteFactory,
36
37 buildPodcastGroupsCache
28} 38}