]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/cache/cache.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / server / middlewares / cache / cache.ts
index e14160ba8ed697225e95a9f02da99334d5510e94..6041c76c3ce75e861036de4b5f8a07ef959af5f9 100644 (file)
@@ -17,12 +17,22 @@ function cacheRoute (duration: string) {
 function cacheRouteFactory (options: APICacheOptions) {
   const instance = new ApiCache({ ...defaultOptions, ...options })
 
-  return instance.buildMiddleware.bind(instance)
+  return { instance, middleware: instance.buildMiddleware.bind(instance) }
+}
+
+// ---------------------------------------------------------------------------
+
+function buildPodcastGroupsCache (options: {
+  channelId: number
+}) {
+  return 'podcast-feed-' + options.channelId
 }
 
 // ---------------------------------------------------------------------------
 
 export {
   cacheRoute,
-  cacheRouteFactory
+  cacheRouteFactory,
+
+  buildPodcastGroupsCache
 }