Repeated wording does not prove that a model provider reused a prompt cache. A request needs to match an eligible cached portion under that provider’s rules. Treat a miss as a debugging problem: compare what was sent, how it was configured and when it was reused.
Compare the rendered request
Inspect the actual request structure, not only the prompt template in source code. A timestamp, reordered tool schema or account-specific instruction can appear before otherwise stable text. That difference can change the reusable prefix.
Use a controlled pair of requests with the same model and settings. Record only safe diagnostics: versions, lengths and a suitably protected comparison identifier. Logging raw prompts is a poor default when they contain customer data.
Check the model’s cache contract
OpenAI’s current documentation describes matching prefixes and eligible lookup boundaries. A model’s minimum cacheable length, supported controls and retention behavior matter. Do not transfer a threshold or configuration from one model to another without checking it.
Put stable reference material before changing task input when that matches the provider’s recommended structure. Confirm that the reusable region has a supported cache boundary. A logically identical request can still have a different serialized prefix.
Test timing and configuration separately
A delayed second request may behave differently from an immediate repeat. So can a model change or a different cache configuration. Run a small matrix: unchanged immediate repeat, unchanged delayed repeat, changed suffix, then changed prefix.
These are diagnostic experiments, not a guarantee that any given request will hit. Keep the workload small enough to inspect, and record cache reads and writes from each response. If the provider supplies diagnostics, use those alongside application logs.
Fix the source of churn
Once a changing field is identified, decide whether it belongs in the reusable part. Moving task-specific material later may help, but do not remove information the model needs for authorization or correctness.
Track both cache reuse and total cost after the change. A longer cacheable prompt can still cost more overall if it adds irrelevant material or generates longer answers. Success means completing the same task correctly at a lower all-in cost, not maximizing a cache badge.
A four-request experiment
Run request A with fixed instructions and task input. Repeat A unchanged, then send B with only the task suffix changed, and C with a controlled change before the reusable boundary. Keep the model and cache settings fixed. Compare reported reads, writes and total input for all four calls. This isolates prefix churn; it does not establish a universal cache threshold or prove that the same result will hold after expiry.
Sign in ↗