Prompt caching correctly — the variable input goes LAST — step 7 of 9
This code was written before March 2026, when Anthropic's default
cache TTL was 1 hour. The dev shipped without ttl, relying on
the default. Anthropic dropped the default to 5 minutes — code
using the default now burns cache writes 12× more often than
intended.
Fix the cache_control to pass ttl: "1h" explicitly so the cache
TTL is locked at 1 hour regardless of provider default changes.
Expected output:
ttl: 1h
This code was written before March 2026, when Anthropic's default
cache TTL was 1 hour. The dev shipped without ttl, relying on
the default. Anthropic dropped the default to 5 minutes — code
using the default now burns cache writes 12× more often than
intended.
Fix the cache_control to pass ttl: "1h" explicitly so the cache
TTL is locked at 1 hour regardless of provider default changes.
Expected output:
ttl: 1h
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.