diff --git a/app/api/lotto/stats/performance/route.ts b/app/api/lotto/stats/performance/route.ts index 7d856f7..4705be0 100644 --- a/app/api/lotto/stats/performance/route.ts +++ b/app/api/lotto/stats/performance/route.ts @@ -1,15 +1,15 @@ import { NextResponse } from 'next/server'; -import { createClient } from '@/lib/supabase/server'; import { nasGet, handleNasError } from '../../_nas'; +// 공개 집계 데이터 — 인증 불필요, Vercel CDN에서 10분 캐시 export const maxDuration = 60; +export const revalidate = 600; // 10분 export async function GET() { try { - const supabase = await createClient(); - const { data: { user } } = await supabase.auth.getUser(); - if (!user) return NextResponse.json({ error: 'UNAUTHORIZED' }, { status: 401 }); const data = await nasGet('/api/lotto/stats/performance'); - return NextResponse.json(data); + const res = NextResponse.json(data); + res.headers.set('Cache-Control', 's-maxage=600, stale-while-revalidate=60'); + return res; } catch (err) { return handleNasError(err); } }