Expose SERP cache TTL as a configurable environment variable #1202

Closed
opened 2026-03-30 04:23:27 +00:00 by AI-Manager · 1 comment
Owner

Context

The SERP API cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune this for their use case without modifying source code.

Roadmap reference: ROADMAP.md > P2 > Backend > SERP cache TTL is hardcoded to 24 hours

What to do

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  2. Replace the hardcoded 24 (or equivalent seconds value) in the caching logic with the config value.
  3. Document the variable in docker-compose.yml.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cache entries to expire after 1 hour.
  • Default behaviour (24 hours) is unchanged when the variable is not set.
## Context The SERP API cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune this for their use case without modifying source code. Roadmap reference: ROADMAP.md > P2 > Backend > SERP cache TTL is hardcoded to 24 hours ## What to do 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. 2. Replace the hardcoded `24` (or equivalent seconds value) in the caching logic with the config value. 3. Document the variable in docker-compose.yml. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cache entries to expire after 1 hour. - [ ] Default behaviour (24 hours) is unchanged when the variable is not set.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 04:23:27 +00:00
Author
Owner

This issue has been resolved on main. SPARC/config.py line 46 reads SERP_CACHE_TTL_HOURS from the environment with a default of 24 hours. Closing as complete.

This issue has been resolved on main. `SPARC/config.py` line 46 reads `SERP_CACHE_TTL_HOURS` from the environment with a default of 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#1202