From b47793c365aaafee08db3cb4fe0b5a070029fb4f Mon Sep 17 00:00:00 2001 From: mikiher Date: Mon, 26 Feb 2024 14:00:25 +0200 Subject: [PATCH] Add cache control header for timestamped cover image requests --- server/controllers/LibraryItemController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/controllers/LibraryItemController.js b/server/controllers/LibraryItemController.js index dfa1daea..3fa7743a 100644 --- a/server/controllers/LibraryItemController.js +++ b/server/controllers/LibraryItemController.js @@ -283,6 +283,9 @@ class LibraryItemController { return res.sendStatus(404) } + if (req.query.ts) + res.set('Cache-Control', 'private, max-age=86400') + if (raw) { // any value if (global.XAccel) { const encodedURI = encodeUriPath(global.XAccel + libraryItem.media.coverPath)