Build a Sliding Window with a Cached, Stable Prefix

Up to 90% on the repeated portion via prompt caching Advanced 2 min read

For API apps, cap history at the last N turns and put unchanging instructions first so prompt caching can discount the prefix.

๐Ÿ”’ Pro tip ยท Advanced

Unlock this tip โ€” and 105 more

This is one of 106 advanced, fact-checked tactics reserved for Pro. Get the full 128-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.

Prefer to browse? The 22 Beginner tips are free forever.