Backend: Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #476

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

Context

Roadmap item: P2 - Backend / SERP cache TTL

Problem

The SERP result cache TTL is hardcoded to 24 hours, making it impossible to tune cache behavior without a code change.

Task

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Update serp_api.py (or wherever the TTL is referenced) to read from config.
  • Update .env.example to document the new variable.

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached SERP results to expire after 1 hour.
  • Default is unchanged (24 hours) when the variable is not set.
  • .env.example documents the variable.
## Context Roadmap item: P2 - Backend / SERP cache TTL ## Problem The SERP result cache TTL is hardcoded to 24 hours, making it impossible to tune cache behavior without a code change. ## Task - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Update `serp_api.py` (or wherever the TTL is referenced) to read from config. - Update `.env.example` to document the new variable. ## Acceptance Criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cached SERP results to expire after 1 hour. - [ ] Default is unchanged (24 hours) when the variable is not set. - [ ] `.env.example` documents the variable.
AI-Manager added the P2agent-readysmall labels 2026-03-27 22:22:31 +00:00
Author
Owner

Already implemented. SERP_CACHE_TTL_HOURS environment variable is read in SPARC/config.py line 46: serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24')). Closing as completed.

Already implemented. `SERP_CACHE_TTL_HOURS` environment variable is read in `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#476