From 999c65a018258c3198f3dff6e820fd59c2aaa370 Mon Sep 17 00:00:00 2001 From: Lucas Rayan Date: Sun, 9 Nov 2025 20:58:19 -0300 Subject: [PATCH] fix: update cache configuration to use dynamic revalidate values in Google Sheets API route --- app/api/placas/route.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/placas/route.js b/app/api/placas/route.js index 96a34cc..b42942c 100644 --- a/app/api/placas/route.js +++ b/app/api/placas/route.js @@ -3,7 +3,7 @@ import { NextResponse } from 'next/server'; // Configurar cache (sempre exportar um nĂºmero, 0 = sem cache) -export const revalidate = 60 * 10; // 10 minutos +export const revalidate = 600; // 10 minutos // Habilitar/desabilitar cache const ENABLE_CACHE = revalidate > 0; @@ -37,7 +37,7 @@ export async function GET() { }); const responseHeaders = ENABLE_CACHE ? { - 'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=7200' + 'Cache-Control': `public, s-maxage=${revalidate}, stale-while-revalidate=${revalidate * 2}` } : { 'Cache-Control': 'no-store, no-cache, must-revalidate' };