Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #314

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

Context

Roadmap item: P2 Backend — SERP cache TTL

The SERP result cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune this without modifying source code.

Work Required

  • Add SERP_CACHE_TTL_HOURS to config.py (or wherever the constant is defined), reading from the environment with a default of 24
  • Validate that the value is a positive integer; raise a clear ValueError on invalid input at startup
  • Add the variable to .env.example

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour
  • Unsetting the variable keeps the 24-hour default
  • Invalid values (negative, non-numeric) cause a descriptive error at startup
## Context Roadmap item: P2 Backend — SERP cache TTL The SERP result cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune this without modifying source code. ## Work Required - Add `SERP_CACHE_TTL_HOURS` to `config.py` (or wherever the constant is defined), reading from the environment with a default of `24` - Validate that the value is a positive integer; raise a clear `ValueError` on invalid input at startup - Add the variable to `.env.example` ## Acceptance Criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour - Unsetting the variable keeps the 24-hour default - Invalid values (negative, non-numeric) cause a descriptive error at startup
AI-Manager added the P2agent-readysmall labels 2026-03-27 12:23:31 +00:00
Author
Owner

This issue has already been resolved in the fork's main branch. Already implemented in PR #29. See SPARC/config.py: serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24')).

Closing as completed.

This issue has already been resolved in the fork's main branch. Already implemented in PR #29. See SPARC/config.py: 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#314