summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/server.js b/server.js
index 5521c53..ba0de61 100644
--- a/server.js
+++ b/server.js
@@ -160,9 +160,9 @@ function login_delete(res, sid) {
function set_static_headers(res, path) {
if (path.match(/\.(jpg|png|svg|webp|ico|woff2)$/))
- res.setHeader("Cache-Control", "max-age=86400")
+ res.setHeader("Cache-Control", "max-age=86400, must-revalidate")
else
- res.setHeader("Cache-Control", "max-age=60")
+ res.setHeader("Cache-Control", "no-cache")
}
let app = express()
@@ -385,6 +385,11 @@ app.get('/', function (req, res) {
res.render('index.pug', { user: req.user })
})
+app.get("/clear-cache", function (req, res) {
+ res.setHeader("Clear-Site-Data", `"cache"`)
+ res.send("Did it work?")
+})
+
app.get('/create', function (req, res) {
res.render('create-index.pug', { user: req.user })
})