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.

cache api.dub.co till next deployment

Steven Tey26024b1a0b1b
diff --git a/apps/web/app/api/route.ts b/apps/web/app/api/route.ts
index 50e1ba7a48..b3149410a1 100644
--- a/apps/web/app/api/route.ts
+++ b/apps/web/app/api/route.ts
@@ -1,8 +1,14 @@
import { document } from "@/lib/openapi";
import { NextResponse } from "next/server";
-export const runtime = "edge";
+export const dynamic = "force-static";
export function GET() {
- return NextResponse.json(document);
+ return NextResponse.json(document, {
+ headers: {
+ // cache indefinitely till next deployment
+ "Vercel-CDN-Cache-Control": "s-maxage=31536000",
+ "Cache-Control": "public, max-age=31536000",
+ },
+ });
}