From 762d8d7d39efd4f3de8b0b5f696c7adc1928095c Mon Sep 17 00:00:00 2001 From: CountBleck Date: Tue, 13 Sep 2022 19:06:37 -0700 Subject: [PATCH] Add max-age value to serve-static This change may improve caching for static assets. However, most HTTP requests are directed to the Bare server, so the improvement the max-age value makes may be negligible. --- app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 239ba84..2b0c093 100644 --- a/app.js +++ b/app.js @@ -14,7 +14,10 @@ const bareServer = createBareServer('/bare/', { const serve = serveStatic(join( dirname(fileURLToPath(import.meta.url)), 'static/' -), {fallthrough: false}); +), { + fallthrough: false, + maxAge: 5 * 60 * 1000 +}); const server = http.createServer();