IO proxy: client-side cache with 5min TTL, server Cache-Control

Client caches IO results by (name + args) in memory. In-flight
promises are cached too (dedup concurrent calls for same args).
Server adds Cache-Control: public, max-age=300 for HTTP caching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 09:51:51 +00:00
parent 0d6b959045
commit 84ea5d4c16
3 changed files with 44 additions and 5 deletions

View File

@@ -601,6 +601,7 @@ def mount_io_endpoint(app: Any, service_name: str) -> None:
result_sx = serialize(result) if result is not None else "nil"
resp = await make_response(result_sx, 200)
resp.content_type = "text/sx; charset=utf-8"
resp.headers["Cache-Control"] = "public, max-age=300"
return resp
io_proxy.__name__ = "sx_io_proxy"