UNPKG

@iosifnicolae2/nextjs-turbo-redis-cache

Version:

[![npm version](https://img.shields.io/npm/v/@trieb.work/nextjs-turbo-redis-cache.svg)](https://www.npmjs.com/package/@trieb.work/nextjs-turbo-redis-cache) ![Turbo redis cache image](https://github.com/user-attachments/assets/98e0dfd9-f38a-42ad-a355-98437

16 lines (14 loc) 421 B
import { revalidatePath } from 'next/cache'; import { NextResponse } from 'next/server'; export async function GET(request: Request) { const { searchParams } = new URL(request.url); const path = searchParams.get('path'); if (!path) { return NextResponse.json( { error: 'Missing path parameter' }, { status: 400 }, ); } revalidatePath(path); return NextResponse.json({ success: true }); }