From 69f99413a0b147493363216f38678be52471c407 Mon Sep 17 00:00:00 2001 From: Amio Date: Tue, 26 Jun 2018 19:13:30 +0800 Subject: [PATCH] Add cache-control 60s --- service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service.js b/service.js index 6e913fc..80bbdf6 100644 --- a/service.js +++ b/service.js @@ -9,7 +9,10 @@ const LRU = require('lru-cache') const cache = new LRU({ max: 1000 }) function serveBadge (req, res, params) { - res.writeHead(200, { 'Content-Type': 'image/svg+xml;charset=utf-8' }) + res.writeHead(200, { + 'Content-Type': 'image/svg+xml;charset=utf-8', + 'Cache-Control': 'public, max-age=60' + }) const cached = cache.get(req.url) if (cached) {