Expose SERP cache TTL as a configurable environment variable #1429

Closed
opened 2026-03-30 19:23:45 +00:00 by AI-Manager · 1 comment
Owner

Summary

The SERP cache TTL is hardcoded to 24 hours in the codebase. Operators cannot tune this without modifying source code.

What to do

  • Add SERP_CACHE_TTL_HOURS to config.py with a default of 24.
  • Replace the hardcoded value in serp_api.py with the configured value.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting SERP_CACHE_TTL_HOURS=48 causes the cache to expire after 48 hours.
  • Default behavior (24h) is preserved when the var is unset.

References

Roadmap: P2 Backend -- configurable SERP cache TTL.

## Summary The SERP cache TTL is hardcoded to 24 hours in the codebase. Operators cannot tune this without modifying source code. ## What to do - Add `SERP_CACHE_TTL_HOURS` to `config.py` with a default of `24`. - Replace the hardcoded value in `serp_api.py` with the configured value. - Document the variable in `.env.example`. ## Acceptance criteria - [ ] Setting `SERP_CACHE_TTL_HOURS=48` causes the cache to expire after 48 hours. - [ ] Default behavior (24h) is preserved when the var is unset. ## References Roadmap: P2 Backend -- configurable SERP cache TTL.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 19:23:45 +00:00
Author
Owner

Already implemented. SPARC/config.py reads SERP_CACHE_TTL_HOURS from the environment: serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24")). This value is documented in .env.example.

Closing as completed.

Already implemented. `SPARC/config.py` reads `SERP_CACHE_TTL_HOURS` from the environment: `serp_cache_ttl_hours = int(os.getenv("SERP_CACHE_TTL_HOURS", "24"))`. This value is documented in `.env.example`. 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#1429