@trieb.work/nextjs-turbo-redis-cache
Version:
Designed for speed, scalability, and optimized performance, nextjs-turbo-redis-cache is your custom cache handler for demanding production environments.
20 lines (15 loc) • 348 B
text/typescript
import { NextResponse } from 'next/server';
let counter = 0;
export async function GET() {
const data = await getSimpleCachedData();
return NextResponse.json(data);
}
async function getSimpleCachedData() {
'use cache';
counter++;
return {
counter,
timestamp: Date.now(),
message: 'Simple cached data without tags',
};
}