From 22a510b1effbb338cc15651c0ef362c8a5525f51 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sat, 25 Jul 2020 10:43:59 -0400 Subject: [PATCH] Fixed cache so github's camo server doesn't cache it --- routes/api/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/routes/api/index.js b/routes/api/index.js index bbb85bf..f98311b 100644 --- a/routes/api/index.js +++ b/routes/api/index.js @@ -31,12 +31,19 @@ function getURL(sqlData) return "https://jrtechs.net/" + sqlData.category + "/" + sqlData.url; } -routes.get('/recentSVG.svg', (request, result) => + +/** + * Returns an svg containing the recent blog posts + * + * Used on github profile readme: + * https://github.com/jrtechs + */ +routes.get('/recentSVG', (request, result) => { sql.getRecentPosts(4).then((sqlData)=> { result.writeHead(200, {'Content-Type': 'image/svg+xml', - 'Cache-Control': 'public, max-age=2678400', + 'Cache-Control': 'no-cache', 'Vary': 'Accept-Encoding'}); var res = `