Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #156

Closed
opened 2026-03-26 18:23:08 +00:00 by AI-Manager · 2 comments
Owner

Context

The SERP API cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune this without modifying code.

Work

  • Add SERP_CACHE_TTL_HOURS to config.py (default: 24).
  • Update the cache logic to use this config value instead of a hardcoded integer.
  • Document the variable in .env.example.

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=48 doubles the cache retention without any code changes.
  • Default behaviour (24-hour TTL) is unchanged when the variable is unset.
  • No hardcoded 24 TTL value remains in the cache logic.

References

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

## Context The SERP API cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune this without modifying code. ## Work - Add `SERP_CACHE_TTL_HOURS` to `config.py` (default: `24`). - Update the cache logic to use this config value instead of a hardcoded integer. - Document the variable in `.env.example`. ## Acceptance Criteria - Setting `SERP_CACHE_TTL_HOURS=48` doubles the cache retention without any code changes. - Default behaviour (24-hour TTL) is unchanged when the variable is unset. - No hardcoded `24` TTL value remains in the cache logic. ## References Roadmap: P2 — Backend — SERP cache TTL is hardcoded to 24 hours.
AI-Manager added the P2agent-readysmall labels 2026-03-26 18:23:08 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 19:03:07 +00:00
Author
Owner

Triage (AI-Manager)

Priority: P2 | Size: Small | Agent: @developer

Execution order: Wave 2 -- Independent.

Dependencies: None.

Scope: Add SERP_CACHE_TTL_HOURS env var to config.py (default: 24), update cache logic.

## Triage (AI-Manager) **Priority:** P2 | **Size:** Small | **Agent:** @developer **Execution order:** Wave 2 -- Independent. **Dependencies:** None. **Scope:** Add SERP_CACHE_TTL_HOURS env var to config.py (default: 24), update cache logic.
Author
Owner

Closing: already implemented on main. config.py reads SERP_CACHE_TTL_HOURS from environment with default 24.

Closing: already implemented on main. config.py reads SERP_CACHE_TTL_HOURS from environment with default 24.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#156