caching layer implementation for improved performance
This commit is contained in:
16
pages/api/cache/stats.ts
vendored
Normal file
16
pages/api/cache/stats.ts
vendored
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user