From d3ef035d008ebb64bc75e3a1bc699fdd6fbe117d Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 17 Feb 2019 00:15:09 -0500 Subject: [PATCH] Attempt to address #103 using the hypothesis that css/js files may be modified (minified?) before being hashed in some situations --- app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app.js b/app.js index d9270ac..68b38c6 100755 --- a/app.js +++ b/app.js @@ -71,6 +71,15 @@ app.use(session({ resave: false, saveUninitialized: false })); + +app.use(function(req, res, next) { + if (req.url.match(/^.*(css|js)$/)) { + res.setHeader("Cache-Control", "no-transform"); + } + + next(); +}); + app.use(express.static(path.join(__dirname, 'public'))); process.on("unhandledRejection", (reason, p) => {