From a2aea7837e6615dbd58a19d738640f2e1df6614c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 31 Jul 2025 23:51:33 +0200 Subject: [PATCH] Reduce cache ttl --- app/api/profiles/[id]/route.ts | 2 +- app/api/profiles/route.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/profiles/[id]/route.ts b/app/api/profiles/[id]/route.ts index a8303c2f..21db85f6 100644 --- a/app/api/profiles/[id]/route.ts +++ b/app/api/profiles/[id]/route.ts @@ -12,7 +12,7 @@ export async function GET( const params = await context.params; const { id } = params; - const cacheStrategy = { swr: 3600, ttl: 3600, tags: ["profiles_id"] }; + const cacheStrategy = { swr: 60, ttl: 60, tags: ["profiles_id"] }; const user = await prisma.user.findUnique({ where: { id }, select: { diff --git a/app/api/profiles/route.ts b/app/api/profiles/route.ts index 66dc230c..17bf22be 100644 --- a/app/api/profiles/route.ts +++ b/app/api/profiles/route.ts @@ -118,7 +118,7 @@ export async function GET(request: Request) { } // Fetch paginated and filtered profiles - const cacheStrategy = { swr: 3600, ttl: 3600 , tags: ["profiles"]}; + const cacheStrategy = { swr: 60, ttl: 60 , tags: ["profiles"]}; const profiles = await prisma.user.findMany({ skip: offset, take: profilesPerPage,