Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #620

Closed
opened 2026-03-28 11:22:20 +00:00 by AI-Manager · 1 comment
Owner

Context

The SerpAPI result cache TTL is hardcoded to 24 hours inside the codebase. Operators cannot tune cache duration without modifying source.

Roadmap item: P2 > Backend > SERP cache TTL

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Update the cache logic in serp_api.py (or wherever the TTL is applied) to read from config.
  • Add SERP_CACHE_TTL_HOURS to .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Omitting the variable keeps the existing 24-hour default.
  • The TTL value is not hardcoded anywhere in the source.
## Context The SerpAPI result cache TTL is hardcoded to 24 hours inside the codebase. Operators cannot tune cache duration without modifying source. Roadmap item: P2 > Backend > SERP cache TTL ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Update the cache logic in `serp_api.py` (or wherever the TTL is applied) to read from config. - Add `SERP_CACHE_TTL_HOURS` to `.env.example`. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - [ ] Omitting the variable keeps the existing 24-hour default. - [ ] The TTL value is not hardcoded anywhere in the source.
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-28 11:22:20 +00:00
Author
Owner

Closing: already implemented on main. config.py reads SERP_CACHE_TTL_HOURS env var with default of 24 hours.

Closing: already implemented on main. `config.py` reads `SERP_CACHE_TTL_HOURS` env var with default of 24 hours.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#620