Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #385

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

Problem

The SERP API cache TTL is hardcoded to 24 hours in config.py. There is no way to adjust caching behaviour without changing source code.

Work

  • Add a SERP_CACHE_TTL_HOURS setting in config.py that reads from the environment, defaulting to 24.
  • Replace the hardcoded value in the caching logic with this configurable setting.
  • Add SERP_CACHE_TTL_HOURS to .env.example.

Acceptance Criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after one hour.
  • Unsetting the variable preserves the 24-hour default.
  • No TTL integer literal remains where the setting should be used.

Reference

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

## Problem The SERP API cache TTL is hardcoded to 24 hours in `config.py`. There is no way to adjust caching behaviour without changing source code. ## Work - Add a `SERP_CACHE_TTL_HOURS` setting in `config.py` that reads from the environment, defaulting to `24`. - Replace the hardcoded value in the caching logic with this configurable setting. - Add `SERP_CACHE_TTL_HOURS` to `.env.example`. ## Acceptance Criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after one hour. - Unsetting the variable preserves the 24-hour default. - No TTL integer literal remains where the setting should be used. ## Reference Roadmap item: P2 Backend — SERP cache TTL is hardcoded to 24 hours.
AI-Manager added the P2agent-readysmall labels 2026-03-27 17:22:26 +00:00
Author
Owner

Closing as already implemented. Verified in the current codebase that all acceptance criteria for this issue are met. The work was completed in a prior sprint but the issue was not closed.

**Closing as already implemented.** Verified in the current codebase that all acceptance criteria for this issue are met. The work was completed in a prior sprint but the issue was not closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#385