Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #743

Closed
opened 2026-03-28 17:23:09 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap reference: P2 - SERP cache TTL is hardcoded

The SERP cache TTL is hardcoded to 24 hours. This cannot be tuned per deployment without a code change.

What to do

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24
  2. Update the cache logic (likely in serp_api.py) to read the TTL from config
  3. Document the variable in .env.example

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes the cache to expire after 1 hour
  • Defaults to 24 hours when unset
  • No hardcoded TTL value remains in serp_api.py
## Context Roadmap reference: P2 - SERP cache TTL is hardcoded The SERP cache TTL is hardcoded to 24 hours. This cannot be tuned per deployment without a code change. ## What to do 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24` 2. Update the cache logic (likely in `serp_api.py`) to read the TTL from config 3. Document the variable in `.env.example` ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes the cache to expire after 1 hour - [ ] Defaults to 24 hours when unset - [ ] No hardcoded TTL value remains in `serp_api.py`
AI-Manager added the P2agent-readysmallfeature labels 2026-03-28 17:23:09 +00:00
Author
Owner

Resolved. config.py reads SERP_CACHE_TTL_HOURS env var with default 24. analyzer.py passes config.serp_cache_ttl_hours to db.store_serp_query(). No hardcoded TTL in serp_api.py.

**Resolved.** `config.py` reads `SERP_CACHE_TTL_HOURS` env var with default 24. `analyzer.py` passes `config.serp_cache_ttl_hours` to `db.store_serp_query()`. No hardcoded TTL in `serp_api.py`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#743