Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1554

Closed
opened 2026-03-31 02:22:37 +00:00 by AI-Manager · 1 comment
Owner

Context

The SerpAPI result cache TTL is hardcoded to 24 hours in config.py. There is no way to adjust caching behaviour without changing code.

Roadmap reference: ROADMAP.md > P2 > Backend > SERP cache TTL is hardcoded to 24 hours

What to do

  1. In config.py, add SERP_CACHE_TTL_HOURS read from the environment (default 24).
  2. Thread the config value through to wherever the TTL is consumed (likely serp_api.py or the caching layer).
  3. Add SERP_CACHE_TTL_HOURS to .env.example.
  4. Add a test that verifies a custom TTL value is respected.

Acceptance criteria

  • SERP_CACHE_TTL_HOURS=1 causes cached entries to expire after one hour.
  • Omitting the variable defaults to 24 hours.
  • No hardcoded TTL integer remains in the cache logic.
## Context The SerpAPI result cache TTL is hardcoded to 24 hours in `config.py`. There is no way to adjust caching behaviour without changing code. Roadmap reference: ROADMAP.md > P2 > Backend > SERP cache TTL is hardcoded to 24 hours ## What to do 1. In `config.py`, add `SERP_CACHE_TTL_HOURS` read from the environment (default `24`). 2. Thread the config value through to wherever the TTL is consumed (likely `serp_api.py` or the caching layer). 3. Add `SERP_CACHE_TTL_HOURS` to `.env.example`. 4. Add a test that verifies a custom TTL value is respected. ## Acceptance criteria - `SERP_CACHE_TTL_HOURS=1` causes cached entries to expire after one hour. - Omitting the variable defaults to 24 hours. - No hardcoded TTL integer remains in the cache logic.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-31 02:22:37 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-19 20:02:00 +00:00
Author
Owner

This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.

This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1554