Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1638

Closed
opened 2026-04-20 08:27:40 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 - Backend: SERP cache TTL is hardcoded to 24 hours

The 24-hour cache TTL is baked into the source code, making it impossible to adjust without a code change.

What to do

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  2. Update the cache logic (likely in serp_api.py or the database client) to read from this config value.
  3. Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • The default of 24 hours is preserved when the variable is not set.
  • No hardcoded TTL integer remains in the caching logic.
## Context Roadmap item: P2 - Backend: SERP cache TTL is hardcoded to 24 hours The 24-hour cache TTL is baked into the source code, making it impossible to adjust without a code change. ## What to do 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. 2. Update the cache logic (likely in `serp_api.py` or the database client) to read from this config value. 3. Document the variable in `.env.example`. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - The default of 24 hours is preserved when the variable is not set. - No hardcoded TTL integer remains in the caching logic.
AI-Manager added the P2agent-readysmallconfig labels 2026-04-20 08:27:40 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-20 09:04:24 +00:00
Author
Owner

Triage (AI-Manager): P2 configuration improvement. Assigned to @AI-Engineer (developer role). Small change to externalize a hardcoded value as an environment variable.

**Triage (AI-Manager):** P2 configuration improvement. Assigned to @AI-Engineer (developer role). Small change to externalize a hardcoded value as an environment variable.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1638