caching layer implementation for improved performance

This commit is contained in:
2025-05-12 16:45:28 +02:00
parent 8022fceff4
commit e1c6a35325
3 changed files with 139 additions and 27 deletions

16
pages/api/cache/stats.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
import type { NextApiRequest, NextApiResponse } from "next"
import { cache } from "../../../lib/cache"
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "GET") return res.status(405).json({ error: "Method not allowed" })
// Simple cache statistics
const stats = {
cache_size: (cache as any).cache?.size || 0,
cache_cleanup_interval: '5 minutes',
last_cleanup: 'Automatic',
cache_implementation: 'In-memory (development mode)'
}
res.json(stats)
}