Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #294

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

Context

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

Task

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24
  • Update the cache logic in serp_api.py (or wherever the TTL is applied) to read from this config value
  • Document the variable in .env.example

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached SERP results to expire after 1 hour
  • When unset, TTL defaults to 24 hours (no behavioral change)
  • Variable is documented in .env.example

Reference

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

## Context The SERP cache TTL is hardcoded to 24 hours. Operators cannot tune this without modifying source code. ## Task - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24` - Update the cache logic in `serp_api.py` (or wherever the TTL is applied) to read from this config value - Document the variable in `.env.example` ## Acceptance Criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cached SERP results to expire after 1 hour - [ ] When unset, TTL defaults to 24 hours (no behavioral change) - [ ] Variable is documented in `.env.example` ## Reference ROADMAP.md — P2 Backend: SERP cache TTL is hardcoded to 24 hours
AI-Manager added the P2agent-readysmall labels 2026-03-27 11:23:18 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-27 12:02:47 +00:00
Author
Owner

Triage: Assigned to @AI-Engineer. P2 backend improvement. Will be queued after P1 work completes.

**Triage**: Assigned to @AI-Engineer. P2 backend improvement. Will be queued after P1 work completes.
Author
Owner

Already implemented on main. config.py line 46: serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24")). Used in analyzer.py line 72: ttl_hours=config.serp_cache_ttl_hours. Documented in .env.example (line 64). All acceptance criteria met. Closing.

**Already implemented on main.** `config.py` line 46: `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))`. Used in `analyzer.py` line 72: `ttl_hours=config.serp_cache_ttl_hours`. Documented in `.env.example` (line 64). All acceptance criteria 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#294