Skip to content

Commit 1c09609

Browse files
committed
fix: remove debug headers, restore proper cache control for OG images
1 parent fbe3026 commit 1c09609

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/routes/[username]/[slug]/og/+server.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,15 @@ export const GET: RequestHandler = async ({ params, platform }) => {
192192
return new Response(pngBuffer, {
193193
headers: {
194194
'Content-Type': 'image/png',
195-
'Cache-Control': 'public, max-age=60',
196-
'X-Font-Count': String(fontBuffers.length),
197-
'X-Font-Size': String(fontBuffers[0]?.length || 0),
198-
'X-Svg-Length': String(svg.length)
195+
'Cache-Control': 'public, max-age=3600, s-maxage=3600'
199196
}
200197
});
201-
} catch (e) {
202-
return new Response(
203-
JSON.stringify({ error: String(e), stack: (e as Error).stack }),
204-
{
205-
status: 500,
206-
headers: { 'Content-Type': 'application/json' }
198+
} catch {
199+
return new Response(svg, {
200+
headers: {
201+
'Content-Type': 'image/svg+xml',
202+
'Cache-Control': 'public, max-age=3600, s-maxage=3600'
207203
}
208-
);
204+
});
209205
}
210206
};

0 commit comments

Comments
 (0)