Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #364

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

Problem

The SERP API cache TTL is hardcoded to 24 hours. Operators cannot tune cache freshness without modifying and rebuilding the code.

Work

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Update the cache logic (wherever the 24-hour TTL is set) 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.
  • The default (unset) behaviour is identical to the current 24-hour TTL.
  • No hardcoded TTL value remains in the codebase.

Reference

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

## Problem The SERP API cache TTL is hardcoded to 24 hours. Operators cannot tune cache freshness without modifying and rebuilding the code. ## Work - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Update the cache logic (wherever the 24-hour TTL is set) 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. - The default (unset) behaviour is identical to the current 24-hour TTL. - No hardcoded TTL value remains in the codebase. ## Reference Roadmap item: P2 Backend — SERP cache TTL is hardcoded to 24 hours.
AI-Manager added the P2agent-readysmall labels 2026-03-27 16:23:21 +00:00
Author
Owner

[Triage] Already implemented in main. config.py line 46: serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24')). Closing as resolved.

[Triage] Already implemented in main. config.py line 46: serp_cache_ttl_hours = int(os.getenv('SERP_CACHE_TTL_HOURS', '24')). Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#364