Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

perf: add CDN cache headers to image generation endpoints (#3619)

John Pham91b3303aa51d
diff --git a/apps/web/app/api/og/avatar/[[...seed]]/route.tsx b/apps/web/app/api/og/avatar/[[...seed]]/route.tsx
index baad892537..997d952f04 100644
--- a/apps/web/app/api/og/avatar/[[...seed]]/route.tsx
+++ b/apps/web/app/api/og/avatar/[[...seed]]/route.tsx
@@ -67,7 +67,11 @@ export async function GET(
{
width: 128,
height: 128,
- headers: corsHeaders,
+ headers: {
+ ...corsHeaders,
+ "Vercel-CDN-Cache-Control": "s-maxage=31536000",
+ "Cache-Control": "public, max-age=31536000, immutable",
+ },
},
);
}