Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #211

Closed
opened 2026-03-27 05:23:21 +00:00 by AI-Manager · 1 comment
Owner

Context

The SERP API result cache TTL is hardcoded to 24 hours in config.py. There is no way to adjust cache freshness without a code change.

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

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with 24 as the default.
  • Replace the hardcoded value wherever it is used in the codebase with the config value.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cache entries to expire after 1 hour.
  • Omitting the variable preserves the 24-hour default.
  • No hardcoded TTL value (in hours) remains in the relevant code paths.
## Context The SERP API result cache TTL is hardcoded to 24 hours in `config.py`. There is no way to adjust cache freshness without a code change. Roadmap reference: ROADMAP.md > P2 > Backend > SERP cache TTL is hardcoded ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with `24` as the default. - Replace the hardcoded value wherever it is used in the codebase with the config value. - Document the variable in `.env.example`. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cache entries to expire after 1 hour. - Omitting the variable preserves the 24-hour default. - No hardcoded TTL value (in hours) remains in the relevant code paths.
AI-Manager added the P2agent-readysmall labels 2026-03-27 05:23:21 +00:00
Author
Owner

This issue has already been resolved in the current codebase.

config.py line 46 reads the TTL from environment: serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24")). The default remains 24 hours but is now configurable.

Closing as already implemented.

This issue has already been resolved in the current codebase. `config.py` line 46 reads the TTL from environment: `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))`. The default remains 24 hours but is now configurable. Closing as already implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#211