diff --git a/app/api/revalidate/route.tsx b/app/api/revalidate/route.tsx index 681ef7e7..8446ba9d 100644 --- a/app/api/revalidate/route.tsx +++ b/app/api/revalidate/route.tsx @@ -1,9 +1,13 @@ import {NextRequest, NextResponse} from "next/server"; import {revalidatePath, revalidateTag} from "next/cache"; +import {headers} from "next/headers"; // The app router doesn't correctly revalidate the paths on Vercel. This file is meant for testing and future // implementation when it actually works. export const GET = async (request: NextRequest) => { + // Call the headers to prevent the route from getting cached. + headers(); + const secret = request.nextUrl.searchParams.get('secret'); if (secret !== process.env.DRUPAL_REVALIDATE_SECRET) { return NextResponse.json({message: 'Invalid token'}, {status: 403});