From 89153c34db751d54067f575ff57780a7240f7139 Mon Sep 17 00:00:00 2001 From: Zefanja Jobse Date: Sun, 13 Aug 2023 17:21:58 +0200 Subject: [PATCH] add cloudflare caching --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 4844af9..0faf7a5 100644 --- a/index.js +++ b/index.js @@ -34,6 +34,7 @@ const cache = (duration) => { } app.get("/amg/1", cache(120), (req, res, next) => { + res.set('Cache-Control', 'public, max-age=120'); Gamedig.query({ type: "forrest", host: "157.90.7.148", @@ -46,6 +47,7 @@ app.get("/amg/1", cache(120), (req, res, next) => { }); app.get("/amg/2", cache(120), (req, res, next) => { + res.set('Cache-Control', 'public, max-age=120'); Gamedig.query({ type: "rust", host: "51.77.77.129", @@ -58,6 +60,7 @@ app.get("/amg/2", cache(120), (req, res, next) => { }); app.get('/game/:gamename/:host/:port', cache(120), (req, res, next) => { + res.set('Cache-Control', 'public, max-age=120'); Gamedig.query({ type: req.params.gamename, host: req.params.host,