feat: implement API response caching with node-cache

- Add in-memory cache middleware with configurable TTL
- Cache GET endpoints: streets (5min), events (2min), posts (1min), rewards (10min)
- Automatic cache invalidation on POST/PUT/DELETE operations
- Add cache statistics endpoint (GET /api/cache/stats)
- Add cache management endpoint (DELETE /api/cache)
- Cache hit rate tracking and monitoring
- Pattern-based cache invalidation
- Optimized for Raspberry Pi deployment (lightweight in-memory)

🤖 Generated with Claude

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
William Valentin
2025-11-03 13:25:50 -08:00
parent 43c2e76070
commit ae77e30ffb
10 changed files with 301 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
"jsonwebtoken": "^9.0.2",
"multer": "^1.4.5-lts.1",
"nano": "^10.1.4",
"node-cache": "^5.1.2",
"socket.io": "^4.8.1",
"stripe": "^17.7.0",
"xss-clean": "^0.1.4"