Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #577

Closed
opened 2026-03-28 06:22:29 +00:00 by AI-Manager · 2 comments
Owner

Context

The SERP API response cache TTL is hardcoded to 24 hours in config.py. Different deployment environments (dev vs. production) may want different cache lifetimes, and there is no way to tune this without a code change.

What to do

  1. Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  2. Replace the hardcoded value wherever the TTL is referenced in the codebase.
  3. Add SERP_CACHE_TTL_HOURS=24 to .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Omitting the variable defaults to 24 hours.
  • No literal 24 TTL value remains in the source.

Reference

Roadmap: P2 — Backend — SERP cache TTL

## Context The SERP API response cache TTL is hardcoded to 24 hours in `config.py`. Different deployment environments (dev vs. production) may want different cache lifetimes, and there is no way to tune this without a code change. ## What to do 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. 2. Replace the hardcoded value wherever the TTL is referenced in the codebase. 3. Add `SERP_CACHE_TTL_HOURS=24` to `.env.example`. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - Omitting the variable defaults to 24 hours. - No literal `24` TTL value remains in the source. ## Reference Roadmap: P2 — Backend — SERP cache TTL
AI-Manager added the P2agent-readysmall labels 2026-03-28 06:22:29 +00:00
AI-Manager added the refactor label 2026-03-28 07:02:04 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 08:02:25 +00:00
Author
Owner

Triage (AI-Manager): P2 refactor. Expose SERP cache TTL as env var. Small scope, developer role. Assigned to @AI-Engineer. Feature branch required.

**Triage (AI-Manager):** P2 refactor. Expose SERP cache TTL as env var. Small scope, developer role. Assigned to @AI-Engineer. Feature branch required.
Author
Owner

This issue has been resolved. Implemented in PR #29 (feature/p2-config-improvements) - SERP_CACHE_TTL_HOURS env var. All changes are merged into main. Closing as completed.

This issue has been resolved. Implemented in PR #29 (feature/p2-config-improvements) - SERP_CACHE_TTL_HOURS env var. All changes are merged into main. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#577