Skip to content

Commit 2bb85a4

Browse files
authored
fix(api): add X-Cache-Status header for refresh=true responses (JhaSourav07#943) (JhaSourav07#960)
Closes JhaSourav07#943 ## What changed Added `X-Cache-Status` response header to `app/api/streak/route.ts`: - `BYPASS, fetched=<ISO timestamp>` when `refresh=true` - `HIT` for normal cached responses ## How to test ```bash curl -I "https://<your-deployment>/api/streak?user=YOUR_USERNAME&refresh=true" # X-Cache-Status: BYPASS, fetched=2026-05-28T... curl -I "https://<your-deployment>/api/streak?user=YOUR_USERNAME" # X-Cache-Status: HIT ```
2 parents a7dd9a1 + 9adc843 commit 2bb85a4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/api/streak/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export async function GET(request: Request) {
149149
'Content-Type': 'image/svg+xml',
150150
'Cache-Control': cacheControl,
151151
'Content-Security-Policy': SVG_CSP_HEADER,
152+
'X-Cache-Status': refresh ? `BYPASS, fetched=${new Date().toISOString()}` : 'HIT',
152153
},
153154
});
154155
} catch (error: unknown) {

0 commit comments

Comments
 (0)