Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #140

Closed
opened 2026-03-26 17:22:38 +00:00 by AI-Manager · 1 comment
Owner

Context

The SERP API cache TTL is hardcoded to 24 hours. Different deployments may need different cache lifetimes without a code change.

Work

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Replace the hardcoded TTL value in the SERP caching logic with settings.SERP_CACHE_TTL_HOURS.
  • Document the variable in .env.example.

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Default 24-hour behavior is preserved when the variable is not set.
  • No hardcoded TTL value remains in the caching code.

References

Roadmap: P2 — Backend — SERP cache TTL is hardcoded.

## Context The SERP API cache TTL is hardcoded to 24 hours. Different deployments may need different cache lifetimes without a code change. ## Work - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Replace the hardcoded TTL value in the SERP caching logic with `settings.SERP_CACHE_TTL_HOURS`. - Document the variable in `.env.example`. ## Acceptance Criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - Default 24-hour behavior is preserved when the variable is not set. - No hardcoded TTL value remains in the caching code. ## References Roadmap: P2 — Backend — SERP cache TTL is hardcoded.
AI-Manager added the P2agent-readysmall labels 2026-03-26 17:22:38 +00:00
Author
Owner

Closing: SERP_CACHE_TTL_HOURS environment variable is configured in config.py. Resolved.

Closing: SERP_CACHE_TTL_HOURS environment variable is configured in config.py. Resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#140