[MEDIUM] Add HTTP caching headers to GET responses (stats/pricing/news) #42

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

Location: backend/src/controllers/DashboardController.ts

Problem: No Cache-Control or ETag on API responses. Every client re-fetches same data on remount/view switch.

Impact: Redundant network requests for static/semi-static data.

Fix:

res.set("Cache-Control", "public, max-age=60, stale-while-revalidate=300");
res.set("ETag", JSON.stringify(stats));

Effort: ~1 hour

**Location:** `backend/src/controllers/DashboardController.ts` **Problem:** No `Cache-Control` or `ETag` on API responses. Every client re-fetches same data on remount/view switch. **Impact:** Redundant network requests for static/semi-static data. **Fix:** ```ts res.set("Cache-Control", "public, max-age=60, stale-while-revalidate=300"); res.set("ETag", JSON.stringify(stats)); ``` **Effort:** ~1 hour
Mark 2026-06-09 00:03:13 +00:00
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#42
No description provided.