Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1409

Closed
opened 2026-03-30 18:22:59 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 -- Backend -- SERP cache TTL is hardcoded

The SerpAPI cache TTL is hardcoded to 24 hours. Operators cannot tune this without modifying source code.

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Use the config value wherever the TTL is currently hardcoded in serp_api.py.
  • Add the variable to .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes the cache to expire entries after 1 hour.
  • The default behaviour is unchanged when the variable is unset.
## Context Roadmap item: P2 -- Backend -- SERP cache TTL is hardcoded The SerpAPI cache TTL is hardcoded to 24 hours. Operators cannot tune this without modifying source code. ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Use the config value wherever the TTL is currently hardcoded in `serp_api.py`. - Add the variable to `.env.example`. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes the cache to expire entries after 1 hour. - [ ] The default behaviour is unchanged when the variable is unset.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 18:22:59 +00:00
Author
Owner

Triage: Already resolved in main.

SERP_CACHE_TTL_HOURS environment variable is implemented in SPARC/config.py line 46: serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24")). Documented in .env.example. Closing as complete.

**Triage: Already resolved in main.** `SERP_CACHE_TTL_HOURS` environment variable is implemented in `SPARC/config.py` line 46: `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))`. Documented in `.env.example`. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1409