Salar Saeedi

Automation & agents · Analysis

Measure prompt caching with real sessions

Test whether a stable prompt prefix lowers repeated work, and track latency and cost separately from answer quality.

Salar Saeedi1 min read
Three-stage illustration — Measure prompt caching with real sessions

A review assistant sends the same policy and ten examples for every case, but inserts the case number at the top. Team members report inconsistent performance and want to know whether changing the order helps.

Locate what actually repeats

OpenAI documents caching for matching prefixes. A test can keep policy and examples fixed, then put each case’s details later. Preserve the hierarchy and meaning of instructions when moving blocks.

Source · OpenAI · Prompt caching

Read the returned usage fields

Compare two runs over the same sample and inspect the provider’s cached-token reporting, time to first output and completion time. Mark model, settings and run order. Retrieval and tool latency can dominate the user’s experience despite less repeated work.

Keep an answer-quality check

A smaller or reorganized context can affect which examples the model uses. Review important outcomes such as whether it requests missing details instead of proceeding blindly.

Source · Anthropic · Context engineering

What to take away

Adopt a prefix layout when the monitored workload shows a repeatable benefit and the acceptance examples still pass.

References

Related work in the portfolio