From 6e569924d758777bae6981fd36ee479b7273dbbd Mon Sep 17 00:00:00 2001 From: Christoph Wiechert Date: Tue, 9 May 2017 00:48:20 +0200 Subject: [PATCH] Add cache-control header to .json response --- lib/endpoints.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/endpoints.js b/lib/endpoints.js index a8ebe63..333628b 100644 --- a/lib/endpoints.js +++ b/lib/endpoints.js @@ -60,6 +60,7 @@ app.get('/:sid', (req, res, next) => { const sid = req.params.sid.substr(0, req.params.sid.length-5); if(!db.get(sid)) return res.status(404).end(); + res.header('Cache-control', 'private, max-age=0, no-cache, no-store, must-revalidate'); res.json({ items: db.get(sid).map(data => { const item = Object.assign(data, {url: `/files/${sid}++${data.key}`});