You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
merge: fix: update cache control headers to s-maxage=1 to prevent stale data… (#7821)
## Description
Fixes#7803
The SVG endpoints (such as `/api/streak`, `/api/stats`, etc.) were
previously setting a `Cache-Control` header of `s-maxage=3600`. Because
GitHub caches external images using its own Camo proxy, this high
max-age meant that users wouldn't see their updated commit stats for up
to an hour after making a contribution.
This PR updates the `buildCacheControlHeader` utility and all associated
API routes to return `s-maxage=1, stale-while-revalidate=59`. This
dramatically reduces the hard caching duration while still allowing CDNs
to serve stale content gracefully while revalidating in the background,
ensuring near real-time updates for SVG widgets embedded in READMEs. All
relevant unit tests testing cache bounds were updated to reflect this
new optimal configuration.
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
- [x] My commits follow the Conventional Commits format (e.g.,
`feat(themes): ...`, `fix(calculate): ...`).
- [ ] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have started the repo.
- [x] I have made sure that i have only one commit to merge in this PR.
- [x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard (no raw elements, smooth animations, correct fonts).
- [x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.
0 commit comments