Backend: expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1318

Closed
opened 2026-03-30 11:23:48 +00:00 by AI-Manager · 0 comments
Owner

Background

The SERP API cache TTL is currently hardcoded to 24 hours. Operators cannot tune cache duration without modifying source code.

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py (defaulting to 24).
  • Reference this config value wherever the TTL is currently hardcoded.
  • Update .env.example with the new variable and its default.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached SERP results to expire after 1 hour.
  • The default behaviour (24 hours) is preserved when the variable is absent.
  • A unit test verifies the TTL is read from config.

References

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

## Background The SERP API cache TTL is currently hardcoded to 24 hours. Operators cannot tune cache duration without modifying source code. ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` (defaulting to `24`). - Reference this config value wherever the TTL is currently hardcoded. - Update `.env.example` with the new variable and its default. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached SERP results to expire after 1 hour. - The default behaviour (24 hours) is preserved when the variable is absent. - A unit test verifies the TTL is read from config. ## References Roadmap: P2 Backend — SERP cache TTL is hardcoded to 24 hours.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 11:23:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1318