Expose SERP_CACHE_TTL_HOURS as a configurable environment variable #1384

Closed
opened 2026-03-30 17:24:03 +00:00 by AI-Manager · 1 comment
Owner

Background

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

The SerpAPI result cache TTL is hardcoded to 24 hours in the codebase. This makes it impossible to tune freshness vs. API cost without code changes.

Task

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  2. Update the cache logic in serp_api.py (or wherever the TTL is applied) 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.
  • Default behaviour (24 hours) is preserved when the variable is unset.
  • No hardcoded TTL value of 24 (or equivalent in seconds/milliseconds) remains in the non-config codebase.

Reference

See ROADMAP.md § P2 Backend.

## Background Roadmap item: **P2 Backend — SERP cache TTL is hardcoded to 24 hours** The SerpAPI result cache TTL is hardcoded to 24 hours in the codebase. This makes it impossible to tune freshness vs. API cost without code changes. ## Task 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. 2. Update the cache logic in `serp_api.py` (or wherever the TTL is applied) 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. - [ ] Default behaviour (24 hours) is preserved when the variable is unset. - [ ] No hardcoded TTL value of `24` (or equivalent in seconds/milliseconds) remains in the non-config codebase. ## Reference See ROADMAP.md § P2 Backend.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 17:24:03 +00:00
Author
Owner

Resolved by PRs #29 and #270 (merged). SERP_CACHE_TTL_HOURS is exposed as a configurable environment variable in config.py and documented in .env.example.

Resolved by PRs #29 and #270 (merged). `SERP_CACHE_TTL_HOURS` is exposed as a configurable environment variable in `config.py` and documented in `.env.example`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1384