feat: disable Vercel cache

This commit is contained in:
Kalidou Diagne
2025-03-13 19:56:42 +00:00
parent cf58cd18ad
commit a79331596e
2 changed files with 2 additions and 3 deletions

View File

@@ -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')

View File

@@ -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,