C.W.K.
Stream
Lesson 02 of 05 · published

Cache Busters: The Top Five

~23 min · cache-busting, timestamps, tool-schemas

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

Small changes can be expensive

Exact prefix matching means harmless-looking differences can destroy cache hits: timestamps at the top, random request IDs, unstable JSON key order, regenerated tool schemas, or changing examples. The expensive part is not the variable content itself. It is placing that variable content before the reusable prefix ends.

The top five cache busters

1. Timestamp or request ID in the first line. 2. Tool schemas regenerated with non-deterministic key order. 3. Examples that get re-shuffled per request. 4. A 'tip of the day' or rotating banner above the rules. 5. User-facing welcome messages that mention the user's name or the current time inside the prefix region.

Make volatility obvious

Put all changing material under a clear tail section. If a timestamp is needed, it goes there. If a tool schema changes, version it intentionally and bump the version field rather than letting unsorted keys change the bytes silently.

Code

Common cache busters·yaml
cache_busters:
  - "timestamp in first line"
  - "random request id before tool schemas"
  - "unsorted JSON schema keys (Python dict ordering quirk)"
  - "rewritten examples every request"
  - "changing image detail parameter"
  - "user name interpolated into rules section"
Stabilize JSON schemas·python
import json
schema_text = json.dumps(SCHEMA, sort_keys=True, indent=2)
# Now every request produces byte-identical schema text -> cache hit.

External links

Exercise

Find three cache busters in a prompt or request builder and move them to the tail or make them stable.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.