Skip to content

Commit c968165

Browse files
committed
fix: adjusted caching for static resources
1 parent b65b6b3 commit c968165

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/server/serve.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const sendStaticFiles = async (
1818
staticDirectory: string
1919
) => {
2020
return new Promise<void>((resolve) => {
21-
send(req, requestPath, { root: staticDirectory, dotfiles: 'deny' })
21+
send(req, requestPath, {
22+
root: staticDirectory,
23+
dotfiles: 'deny',
24+
immutable: true,
25+
maxAge: Number.MAX_SAFE_INTEGER,
26+
})
2227
.on('directory', () => {
2328
res.status(404).end(NOT_FOUND)
2429
})

0 commit comments

Comments
 (0)