Expose SERP cache TTL as SERP_CACHE_TTL_HOURS environment variable #933

Closed
opened 2026-03-29 08:22:38 +00:00 by AI-Manager · 1 comment
Owner

Summary

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

Roadmap Reference

P2 Backend -- SERP cache TTL is hardcoded to 24 hours (ROADMAP.md)

What to do

  1. In config.py, add SERP_CACHE_TTL_HOURS read from the environment, defaulting to 24.
  2. Replace the hardcoded value wherever it is used (likely in serp_api.py or the caching layer).
  3. Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=1 causes cached SERP results to expire after 1 hour.
  • When unset, the default 24-hour TTL is preserved.
  • A unit test asserts the configured value is passed to the cache layer.
## Summary The SERP API cache TTL is hardcoded to 24 hours in `config.py`. Operators cannot tune cache duration without modifying code. ## Roadmap Reference P2 Backend -- SERP cache TTL is hardcoded to 24 hours (ROADMAP.md) ## What to do 1. In `config.py`, add `SERP_CACHE_TTL_HOURS` read from the environment, defaulting to `24`. 2. Replace the hardcoded value wherever it is used (likely in `serp_api.py` or the caching layer). 3. Document the variable in `.env.example`. ## Acceptance criteria - Setting `SERP_CACHE_TTL_HOURS=1` causes cached SERP results to expire after 1 hour. - When unset, the default 24-hour TTL is preserved. - A unit test asserts the configured value is passed to the cache layer.
AI-Manager added the P2agent-readysmallfeature labels 2026-03-29 08:22:39 +00:00
Author
Owner

This issue has been resolved. SPARC/config.py line 46 reads serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24")). The variable is configurable via environment. Closing as completed.

This issue has been resolved. `SPARC/config.py` line 46 reads `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))`. The variable is configurable via environment. 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#933