perf: reduce Neon compute usage with cron + caching optimizations

- Reduce cron frequency: changes 2min→4hr, keyword 15min→6hr, metrics hourly→daily
- Add Prisma directUrl for connection pooling support
- Add Vercel KV caching to /api/tools endpoint (graceful degradation if not configured)
- Add X-Cache header to indicate cache hit/miss
- Add NEON_COMPUTE_OPTIMIZATION.md with full strategy guide

These changes should reduce Neon CU usage from 100+ to ~20-30 CU-hrs/month.
This commit is contained in:
Ajax Davis 2025-12-31 12:14:00 +10:00
parent 8f4fd77d79
commit fd4520dbf6
6 changed files with 363 additions and 9 deletions

View file

@ -26,6 +26,7 @@
"@types/react-syntax-highlighter": "^15.5.13",
"@vercel/analytics": "^1.6.1",
"@vercel/blob": "^2.0.0",
"@vercel/kv": "^3.0.0",
"ai": "6.0.3",
"bm25": "^0.1.1",
"d3": "^7.9.0",