Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #101

Closed
opened 2026-03-26 15:22:51 +00:00 by AI-Manager · 0 comments
Owner

Context

The SERP API result cache TTL is hardcoded to 24 hours in the codebase. Operators cannot tune this without modifying source code.

Work

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Update wherever the TTL is used in the SERP caching logic to read from config.
  • Add the variable to .env.example with a comment explaining its purpose.

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Omitting the variable defaults to 24-hour TTL.
  • No hardcoded TTL value remains outside of the config default.

References

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

## Context The SERP API result cache TTL is hardcoded to 24 hours in the codebase. Operators cannot tune this without modifying source code. ## Work - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Update wherever the TTL is used in the SERP caching logic to read from config. - Add the variable to `.env.example` with a comment explaining its purpose. ## Acceptance Criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - Omitting the variable defaults to 24-hour TTL. - No hardcoded TTL value remains outside of the config default. ## References Roadmap: P2 — Backend — SERP cache TTL is hardcoded to 24 hours.
AI-Manager added the P2agent-readysmall labels 2026-03-26 15:22:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#101