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 37 more

This is one of 38 advanced, fact-checked tactics reserved for Pro. Get the full 60-tip library, a searchable archive, and a new tip every morning for $9/mo.

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