[MEDIUM] Add maxAge and immutable to express.static for frontend assets #38

Closed
opened 2026-06-09 00:03:13 +00:00 by Mark · 0 comments
Owner

Location: backend/src/app.ts:75

Problem: express.static(frontendPath) has no caching options. Browser re-fetches JS/CSS bundles on every navigation.

Impact: Unnecessary asset re-downloads.

Fix:

app.use(express.static(frontendPath, { maxAge: "1y", immutable: true }));

Effort: ~5 mins

**Location:** `backend/src/app.ts:75` **Problem:** `express.static(frontendPath)` has no caching options. Browser re-fetches JS/CSS bundles on every navigation. **Impact:** Unnecessary asset re-downloads. **Fix:** ```ts app.use(express.static(frontendPath, { maxAge: "1y", immutable: true })); ``` **Effort:** ~5 mins
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#38
No description provided.