revalidateTagrevalidateTag allows you to revalidate data associated with a specific cache tag. This is useful for scenarios where you want to update your cached data without waiting for a revalidation period to expire.
app/api/revalidate/route.ts import { NextRequest, NextResponse } from 'next/server'
import { revalidateTag } from 'next/cache'
 
export async function GET(request: NextRequest) {
  const tag = request.nextUrl.searchParams.get('tag')
  revalidateTag(tag)
  return NextResponse.json({ revalidated: true, now: Date.now() })
}
Good to know:
revalidateTag is available in both Node.js and Edge runtimes.
Parameters
 revalidateTag(tag: string): void;
tag: A string representing the cache tag associated with the data you want to revalidate.
You can add tags to fetch as follows: