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.
This commit is contained in:
CountBleck 2022-09-13 19:06:37 -07:00
parent 1fb7d3c6fc
commit 762d8d7d39
No known key found for this signature in database

5
app.js
View file

@ -14,7 +14,10 @@ const bareServer = createBareServer('/bare/', {
const serve = serveStatic(join( const serve = serveStatic(join(
dirname(fileURLToPath(import.meta.url)), dirname(fileURLToPath(import.meta.url)),
'static/' 'static/'
), {fallthrough: false}); ), {
fallthrough: false,
maxAge: 5 * 60 * 1000
});
const server = http.createServer(); const server = http.createServer();