From a79331596e9a395967ec4c0ab8d050f704f4f704 Mon Sep 17 00:00:00 2001 From: Kalidou Diagne Date: Thu, 13 Mar 2025 19:56:42 +0000 Subject: [PATCH] feat: disable Vercel cache --- app/api/events/route.ts | 3 +-- hooks/useNotion.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/api/events/route.ts b/app/api/events/route.ts index 0a5ced7..9bbbd23 100644 --- a/app/api/events/route.ts +++ b/app/api/events/route.ts @@ -44,10 +44,9 @@ export async function GET() { const responseJson = NextResponse.json({ events, page }) - // Disable vercel cache responseJson.headers.set( 'Cache-Control', - 'no-store, no-cache, must-revalidate, proxy-revalidate' + 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0, s-maxage=0, stale-while-revalidate=0' ) responseJson.headers.set('Pragma', 'no-cache') responseJson.headers.set('Expires', '0') diff --git a/hooks/useNotion.ts b/hooks/useNotion.ts index cd30c02..974e24c 100644 --- a/hooks/useNotion.ts +++ b/hooks/useNotion.ts @@ -16,7 +16,7 @@ const fetcher = async (url: string) => { export function useGetNotionEvents() { const { data, error } = useSWR<{ events: EventProps['event'][]; page: any }>( - `/api/events`, + `/api/events?timestamp=${Date.now()}`, fetcher, { refreshInterval: 60000,