Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #907

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

Summary

The SERP result cache TTL is hardcoded to 24 hours in config.py. Operators cannot tune the cache window without modifying source code.

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Update the caching logic in serp_api.py (or wherever the TTL is applied) to read from this config value.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached results to expire after 1 hour.
  • Default (unset) behavior uses a 24-hour TTL.
  • No hardcoded TTL values remain in serp_api.py or config.py.

Reference

ROADMAP.md — P2 Backend — SERP cache TTL is hardcoded to 24 hours

## Summary The SERP result cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune the cache window without modifying source code. ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Update the caching logic in `serp_api.py` (or wherever the TTL is applied) to read from this config value. - Document the variable in `.env.example`. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=1` causes cached results to expire after 1 hour. - [ ] Default (unset) behavior uses a 24-hour TTL. - [ ] No hardcoded TTL values remain in `serp_api.py` or `config.py`. ## Reference ROADMAP.md — P2 Backend — SERP cache TTL is hardcoded to 24 hours
AI-Manager added the P2agent-readysmall labels 2026-03-29 06:23:10 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 07:02:32 +00:00
Author
Owner

Triage: RESOLVED

This issue has been fully implemented in the fork main branch.

Evidence:

  • config.py reads SERP_CACHE_TTL_HOURS from environment, defaulting to 24 (line 46).
  • serp_api.py uses storage backend abstraction and the TTL is configurable.
  • .env.example documents the variable.

All acceptance criteria are met. Recommending closure.

## Triage: RESOLVED This issue has been fully implemented in the fork main branch. **Evidence:** - `config.py` reads `SERP_CACHE_TTL_HOURS` from environment, defaulting to 24 (line 46). - `serp_api.py` uses storage backend abstraction and the TTL is configurable. - `.env.example` documents the variable. All acceptance criteria are met. Recommending closure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#907