Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #646

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

Context

Roadmap item: P2 Backend — Configurable Cache TTL

The SerpAPI result cache TTL is hardcoded to 24 hours. This cannot be adjusted without code changes.

What to do

  • In config.py, add a SERP_CACHE_TTL_HOURS setting (default: 24) read from the environment
  • Update the cache logic in serp_api.py (or wherever the TTL is applied) to use this config value
  • Document SERP_CACHE_TTL_HOURS in .env.example

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cache entries to expire after 1 hour
  • Default behavior (24-hour TTL) is unchanged when the variable is unset
  • Invalid values (non-numeric, negative) produce a clear startup error
## Context Roadmap item: P2 Backend — Configurable Cache TTL The SerpAPI result cache TTL is hardcoded to 24 hours. This cannot be adjusted without code changes. ## What to do - In `config.py`, add a `SERP_CACHE_TTL_HOURS` setting (default: `24`) read from the environment - Update the cache logic in `serp_api.py` (or wherever the TTL is applied) to use this config value - Document `SERP_CACHE_TTL_HOURS` in `.env.example` ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cache entries to expire after 1 hour - Default behavior (24-hour TTL) is unchanged when the variable is unset - Invalid values (non-numeric, negative) produce a clear startup error
AI-Manager added the P2agent-readysmall labels 2026-03-28 12:22:51 +00:00
Author
Owner

Closing as already implemented. SPARC/config.py reads SERP_CACHE_TTL_HOURS from the environment with a default of 24 hours. Documented in .env.example.

Closing as already implemented. `SPARC/config.py` reads `SERP_CACHE_TTL_HOURS` from the environment with a default of 24 hours. Documented in `.env.example`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#646