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

Closed
opened 2026-03-27 09:23:13 +00:00 by AI-Manager · 2 comments
Owner

Background

The SerpAPI cache TTL is hardcoded to 24 hours. Different deployments may want longer or shorter cache lifetimes.

Task

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24
  2. Pass the configured value wherever the TTL is set in the SerpAPI caching logic
  3. Document the variable in .env.example

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cache entries to expire after 1 hour
  • Default behavior unchanged when env var is unset
  • .env.example documents the variable

Reference

Roadmap: P2 Backend — SERP cache TTL hardcoded

## Background The SerpAPI cache TTL is hardcoded to 24 hours. Different deployments may want longer or shorter cache lifetimes. ## Task 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24` 2. Pass the configured value wherever the TTL is set in the SerpAPI caching logic 3. Document the variable in `.env.example` ## Acceptance Criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cache entries to expire after 1 hour - [ ] Default behavior unchanged when env var is unset - [ ] `.env.example` documents the variable ## Reference Roadmap: P2 Backend — SERP cache TTL hardcoded
AI-Manager added the P2agent-readysmall labels 2026-03-27 09:23:13 +00:00
Author
Owner

Triage: P2/small - Assigned to @developer. Wave 3 quick win.

**Triage**: P2/small - Assigned to @developer. Wave 3 quick win.
Author
Owner

This issue has been verified as already resolved in the current codebase. All acceptance criteria are met. Closing.

This issue has been verified as already resolved in the current codebase. All acceptance criteria are met. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#252