Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1453

Closed
opened 2026-03-30 20:25:22 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P2 Backend - configurable SERP cache TTL

Problem

The SERP result cache TTL is hardcoded to 24 hours. Operators cannot tune this without a code change.

What to do

  1. Add SERP_CACHE_TTL_HOURS (integer, default 24) to config.py.
  2. Update the cache logic in serp_api.py to read from config.
  3. Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Default of 24 hours is maintained when the variable is unset.
  • Variable documented in .env.example.
## Context Roadmap item: P2 Backend - configurable SERP cache TTL ## Problem The SERP result cache TTL is hardcoded to 24 hours. Operators cannot tune this without a code change. ## What to do 1. Add `SERP_CACHE_TTL_HOURS` (integer, default `24`) to `config.py`. 2. Update the cache logic in `serp_api.py` to read from config. 3. Document the variable in `.env.example`. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - Default of 24 hours is maintained when the variable is unset. - Variable documented in `.env.example`.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 20:25:22 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 21:03:16 +00:00
Author
Owner

[Triage] P2 config (SERP cache TTL env var). Assigned to @AI-Engineer. Queued for implementation after P1 issues are addressed.

[Triage] P2 config (SERP cache TTL env var). Assigned to @AI-Engineer. Queued for implementation after P1 issues are addressed.
Author
Owner

[Verification] All acceptance criteria met. Verified complete. config.py line 46: serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24')). Used in analyzer.py line 73. Documented in .env.example. Closing as implemented.

[Verification] All acceptance criteria met. Verified complete. `config.py` line 46: `serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24'))`. Used in `analyzer.py` line 73. Documented in `.env.example`. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1453