Add prompt-caching module: Spring AI 2.1 Anthropic cache strategies on the real request (breakpoints per strategy, hit/miss/write in Usage, one changed word, multi-block system caching, minimum length, 5-minute and 1-hour lifetimes, the 20-block lookback), OpenAI automatic caching with prompt_cache_key, and a cost table. The vendors are a local server applying their documented rules; no vendor API called. Spring Boot 4.2.0, Spring AI 2.1.0, Java 25.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4gvXXQgw1eTk5EoTT
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Cache lifetime: 5 minutes refreshed by every read, or 1 hour (SYSTEM_ONLY, virtual clock)
|
||||
|
||||
TTL FIVE_MINUTES (cache_control sent: {"type":"ephemeral","ttl":"5m"})
|
||||
t= 0s (gap 0s) MISS write=6078
|
||||
t= 240s (gap 240s) HIT read=6078
|
||||
t= 530s (gap 290s) HIT read=6078
|
||||
t= 831s (gap 301s) MISS write=6078
|
||||
t= 931s (gap 100s) HIT read=6078
|
||||
t= 2731s (gap 1800s) MISS write=6078
|
||||
|
||||
TTL ONE_HOUR (cache_control sent: {"type":"ephemeral","ttl":"1h"})
|
||||
t= 0s (gap 0s) MISS write=6078
|
||||
t= 240s (gap 240s) HIT read=6078
|
||||
t= 530s (gap 290s) HIT read=6078
|
||||
t= 831s (gap 301s) HIT read=6078
|
||||
t= 931s (gap 100s) HIT read=6078
|
||||
t= 2731s (gap 1800s) HIT read=6078
|
||||
|
||||
Reference in New Issue
Block a user