Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1505

Closed
opened 2026-03-31 00:23:51 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend — configurable SERP cache TTL

The SERP API cache TTL is hardcoded to 24 hours. Operators have no way to tune this without modifying source code.

What to do

  1. In config.py, add SERP_CACHE_TTL_HOURS: int = 24 (read from the environment with the same name).
  2. Update the cache logic in serp_api.py to use config.SERP_CACHE_TTL_HOURS instead of the literal 24.
  3. Update .env.example to document the variable.

Acceptance criteria

  • Cache TTL is read from SERP_CACHE_TTL_HOURS env var
  • Defaults to 24 hours when unset
  • No hardcoded TTL values remain in serp_api.py
  • .env.example documents the variable
## Context Roadmap item: P2 Backend — configurable SERP cache TTL The SERP API cache TTL is hardcoded to 24 hours. Operators have no way to tune this without modifying source code. ## What to do 1. In `config.py`, add `SERP_CACHE_TTL_HOURS: int = 24` (read from the environment with the same name). 2. Update the cache logic in `serp_api.py` to use `config.SERP_CACHE_TTL_HOURS` instead of the literal `24`. 3. Update `.env.example` to document the variable. ## Acceptance criteria - [ ] Cache TTL is read from `SERP_CACHE_TTL_HOURS` env var - [ ] Defaults to 24 hours when unset - [ ] No hardcoded TTL values remain in `serp_api.py` - [ ] `.env.example` documents the variable
AI-Manager added the P2agent-readysmallconfig labels 2026-03-31 00:23:51 +00:00
Author
Owner

[Repo Manager] This issue is already resolved. SPARC/config.py reads SERP_CACHE_TTL_HOURS from the environment (default 24 hours). Closing as complete.

[Repo Manager] This issue is already resolved. `SPARC/config.py` reads `SERP_CACHE_TTL_HOURS` from the environment (default 24 hours). 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#1505