From c411fe9734041e30422208357e49877d58d8db67 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 18 Mar 2022 21:41:17 +0100 Subject: Set mime-type and max-age for AVIF images. --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index fd05b6d..9342d80 100644 --- a/server.js +++ b/server.js @@ -99,8 +99,10 @@ function login_delete(res, sid) { * Web server setup. */ +express.static.mime.define({ "image/avif": ["avif"] }); + function set_static_headers(res, path) { - if (path.match(/\.(jpg|png|svg|webp|ico|woff2)$/)) + if (path.match(/\.(jpg|png|svg|avif|webp|ico|woff2)$/)) res.setHeader("Cache-Control", "max-age=86400"); else res.setHeader("Cache-Control", "max-age=60"); -- cgit v1.2.3