mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-01 11:19:34 +00:00
Fixed Next.js Middleware, Added API Route Caching, and Removed Unused Packages
This commit is contained in:
parent
a25d2bf951
commit
a9bd470c68
5 changed files with 48 additions and 244 deletions
|
@ -29,7 +29,14 @@ export async function GET(
|
|||
take: 3,
|
||||
});
|
||||
|
||||
return NextResponse.json(auditLogs);
|
||||
return new NextResponse(JSON.stringify(auditLogs), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Cache-Control': 'public, s-maxage=5',
|
||||
'CDN-Cache-Control': 'public, s-maxage=60',
|
||||
'Vercel-CDN-Cache-Control': 'public, s-maxage=3600',
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
return new NextResponse(JSON.stringify(error), { status: 500 });
|
||||
}
|
||||
|
|
|
@ -34,7 +34,14 @@ export async function GET(
|
|||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(card);
|
||||
return new NextResponse(JSON.stringify(card), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Cache-Control': 'public, s-maxage=1',
|
||||
'CDN-Cache-Control': 'public, s-maxage=60',
|
||||
'Vercel-CDN-Cache-Control': 'public, s-maxage=3600',
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
return new NextResponse(JSON.stringify(error), { status: 500 });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue