From e2a03dcf8c0347fc481461072b7877446096d618 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 27 May 2026 19:29:43 +0530 Subject: [PATCH] fix(api): do not cache error SVG responses on CDN --- app/api/streak/route.test.ts | 2 +- app/api/streak/route.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/streak/route.test.ts b/app/api/streak/route.test.ts index 61948085..e20cfa21 100644 --- a/app/api/streak/route.test.ts +++ b/app/api/streak/route.test.ts @@ -443,7 +443,7 @@ describe('GET /api/streak', () => { const response = await GET(makeRequest({ user: 'octocat' })); - expect(response.headers.get('Cache-Control')).toBe('public, s-maxage=60'); + expect(response.headers.get('Cache-Control')).toBe('no-store'); }); it('returns a valid 500 SVG even when something non-Error is thrown', async () => { diff --git a/app/api/streak/route.ts b/app/api/streak/route.ts index 6e3c926e..b6477a2d 100644 --- a/app/api/streak/route.ts +++ b/app/api/streak/route.ts @@ -217,7 +217,7 @@ function buildErrorResponse(error: unknown, parseResult: ParseResult): NextRespo status: 500, headers: { 'Content-Type': 'image/svg+xml', - 'Cache-Control': 'public, s-maxage=60', + 'Cache-Control': 'no-store', }, }); }