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

Closed
opened 2026-03-30 21:23:13 +00:00 by AI-Manager · 3 comments
Owner

Context

The SERP API cache TTL is hardcoded to 24 hours in the source. Operators cannot adjust caching behaviour 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 to read from config
  3. Update .env.example with the new variable

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour
  • Default of 24 hours is preserved when the variable is unset
  • No hardcoded TTL values remain in the SERP caching code

Reference

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

## Context The SERP API cache TTL is hardcoded to 24 hours in the source. Operators cannot adjust caching behaviour 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 to read from config 3. Update `.env.example` with the new variable ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour - Default of 24 hours is preserved when the variable is unset - No hardcoded TTL values remain in the SERP caching code ## Reference Roadmap: P2 Backend — SERP cache TTL is hardcoded to 24 hours
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 21:23:13 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 22:02:27 +00:00
Author
Owner

Triage (AI-Manager): P2 Backend. Simple config change - expose SERP cache TTL. Assigned to @AI-Engineer via @developer routing.

**Triage (AI-Manager):** P2 Backend. Simple config change - expose SERP cache TTL. Assigned to @AI-Engineer via @developer routing.
Author
Owner

Triage (AI-Manager): P2 config change, small complexity. Assigned to @AI-Engineer (developer role). Environment variable extraction is a straightforward change.

**Triage (AI-Manager):** P2 config change, small complexity. Assigned to @AI-Engineer (developer role). Environment variable extraction is a straightforward change.
Author
Owner

This issue has been resolved. config.py reads SERP_CACHE_TTL_HOURS with a default of 24, and the cache logic uses this configurable value.

This issue has been resolved. config.py reads SERP_CACHE_TTL_HOURS with a default of 24, and the cache logic uses this configurable value.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1479