Description
Analyzing the same video multiple times hits the Gemini API repeatedly and costs money. Implement Redis caching for analysis results.
Acceptance Criteria
Implementation Details
- Use Redis hash key:
liveedit:analysis:{file_hash}
- Store: analysis result + timestamp
- Check cache in
/api/analyze-video endpoint before calling Gemini
- Add cache metrics endpoint: GET
/api/cache/stats
Configuration
- Add to
.env: CACHE_TTL=604800 (7 days in seconds)
- Add to
.env: ENABLE_ANALYSIS_CACHE=true
Difficulty: Medium
Estimated time: 3-4 hours
Description
Analyzing the same video multiple times hits the Gemini API repeatedly and costs money. Implement Redis caching for analysis results.
Acceptance Criteria
?skip_cache=trueImplementation Details
liveedit:analysis:{file_hash}/api/analyze-videoendpoint before calling Gemini/api/cache/statsConfiguration
.env:CACHE_TTL=604800(7 days in seconds).env:ENABLE_ANALYSIS_CACHE=trueDifficulty: Medium
Estimated time: 3-4 hours