diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-03-18 21:41:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-03-18 21:41:34 +0100 |
commit | c411fe9734041e30422208357e49877d58d8db67 (patch) | |
tree | 79b0f5ddd0d78b8591a3408de639961031a19b68 | |
parent | 6863e07e6efd9c7b5cd8c0191b506698c155f3a4 (diff) | |
download | server-c411fe9734041e30422208357e49877d58d8db67.tar.gz |
Set mime-type and max-age for AVIF images.
-rw-r--r-- | server.js | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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"); |