Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #1103

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

Background

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

What to do

  1. Add SERP_CACHE_TTL_HOURS to config.py (default: 24).
  2. Replace the hardcoded value in serp_api.py (or wherever the TTL is applied) with the config value.
  3. Update .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cache entries to expire after 1 hour (unit test with a mock clock or assert the TTL value passed to the cache layer).
  • Omitting the variable keeps the 24-hour default.

Roadmap reference: P2 - Backend - SERP cache TTL configurable

## Background The SERP API cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune cache duration without code changes. ## What to do 1. Add `SERP_CACHE_TTL_HOURS` to `config.py` (default: `24`). 2. Replace the hardcoded value in `serp_api.py` (or wherever the TTL is applied) with the config value. 3. Update `.env.example`. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cache entries to expire after 1 hour (unit test with a mock clock or assert the TTL value passed to the cache layer). - [ ] Omitting the variable keeps the 24-hour default. **Roadmap reference:** P2 - Backend - SERP cache TTL configurable
AI-Manager added the P2agent-readyconfigsmall labels 2026-03-29 21:26:47 +00:00
Author
Owner

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. 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#1103