Expose SERP cache TTL as a SERP_CACHE_TTL_HOURS environment variable #669

Closed
opened 2026-03-28 13:22:58 +00:00 by AI-Manager · 1 comment
Owner

Context

The SERP result cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune cache freshness without changing code.

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Replace the hardcoded value in the cache logic 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.
  • Unset variable defaults to 24 hours (existing behaviour preserved).
  • No magic numbers for TTL remain in source.
  • .env.example includes the variable.

References

Roadmap item: P2 Backend — configurable SERP cache TTL.

## Context The SERP result cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune cache freshness without changing code. ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Replace the hardcoded value in the cache logic 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. - [ ] Unset variable defaults to 24 hours (existing behaviour preserved). - [ ] No magic numbers for TTL remain in source. - [ ] `.env.example` includes the variable. ## References Roadmap item: P2 Backend — configurable SERP cache TTL.
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-28 13:22:58 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 14:03:02 +00:00
Author
Owner

Triage: Already implemented

This issue has been fully addressed in the fork main branch.

Verification:

  • SPARC/config.py reads SERP_CACHE_TTL_HOURS env var with default 24 (line 46).
  • Cache logic uses config.serp_cache_ttl_hours instead of magic numbers.
  • .env.example documents the variable (line 64).

All acceptance criteria are met. Closing.

## Triage: Already implemented This issue has been fully addressed in the fork main branch. **Verification:** - `SPARC/config.py` reads `SERP_CACHE_TTL_HOURS` env var with default 24 (line 46). - Cache logic uses `config.serp_cache_ttl_hours` instead of magic numbers. - `.env.example` documents the variable (line 64). All acceptance criteria are 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#669