Skip to content

Commit 0b3edaa

Browse files
committed
Increase cache duration for static assets to one year
1 parent 5b6438c commit 0b3edaa

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/server/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if (process.env["NODE_ENV"] === "development") {
5959
server.use(
6060
getStaticDir(),
6161
express.static(serverPath, {
62-
maxAge: 24 * 60 * 60 * 1000, // 1 day
62+
maxAge: 365 * 24 * 60 * 60 * 1000, // 1 year
6363
immutable: true,
6464
}),
6565
);

src/server/middleware.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export function setCacheControl(
3939
res: Response,
4040
next: NextFunction,
4141
) {
42-
if (process.env.NODE_ENV !== "production") {
43-
return next();
44-
}
45-
4642
let caching: string;
4743

4844
// Only allow caching for success responses

0 commit comments

Comments
 (0)