Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1274

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

Context

The SERP result cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune cache freshness without editing code.

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

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py, defaulting to 24.
  • Replace the hardcoded value in the cache logic with config.SERP_CACHE_TTL_HOURS.
  • Add the variable to .env.example with its default and a brief description.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached entries to expire after 1 hour.
  • Omitting the variable keeps the existing 24-hour behaviour.
  • No hardcoded TTL value remains in the cache logic.
## Context The SERP result cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune cache freshness without editing code. Roadmap reference: P2 - Backend: SERP cache TTL is hardcoded ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py`, defaulting to `24`. - Replace the hardcoded value in the cache logic with `config.SERP_CACHE_TTL_HOURS`. - Add the variable to `.env.example` with its default and a brief description. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached entries to expire after 1 hour. - Omitting the variable keeps the existing 24-hour behaviour. - No hardcoded TTL value remains in the cache logic.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 09:23:26 +00:00
Author
Owner

Triage: Already Implemented

The SERP cache TTL env var is implemented on main:

  • SPARC/config.py line 46: serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))

Closing as completed.

## Triage: Already Implemented The SERP cache TTL env var is implemented on `main`: - `SPARC/config.py` line 46: `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))` Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1274