For repeated document questions sent to DeepSeek-V4.1-Flash on the direct DeepSeek API, keep the reusable instructions and document at the beginning, put the changing question afterward, and check the reported cache tokens across successive requests. Repeated text is not, by itself, proof that the next request will hit the cache. The important boundary is a complete, already persisted prefix unit.
The model-to-endpoint link matters here: the official V4.1-Flash announcement, as captured on September 10, 2026, directs API clients to use deepseek-flash. The context-caching guide says caching is enabled by default for all DeepSeek API users. Together, these support applying the guide to that direct-API route. This is provider-level guidance for using V4.1-Flash, not evidence of a caching mechanism exclusive to this model, a permanent version pin, or equivalent behavior on third-party endpoints.
Why the second document question can miss
The guide describes cached prefixes as independent, complete units. A later request must fully match a persisted unit to reuse it. It identifies three ways units are persisted: at request boundaries, through detection of common prefixes across requests, and at fixed token intervals for long inputs or outputs.
Its common-prefix example is the useful counterexample to “same document means a hit”:
| Request | Input shape | What the documented example establishes |
|---|---|---|
| First | A + B |
The request establishes a prefix unit for A + B. |
| Second | A + C |
Sharing A does not fully match the earlier A + B unit. This request misses in the example; common-prefix detection then persists A separately. |
| Third | A + D |
The request can now match the persisted A unit. |
For document Q&A, A is the stable system instruction plus document content, while B, C, and D are different questions. The guide’s financial-report example explicitly describes the first two requests missing and the third being able to reuse the common prefix. That sequence explains the mechanism; it is not a promise that every third request hits. Construction takes seconds, and cache operation is best-effort.
A reproducible layout check for this route
Use the following as a proposed check, not as a reported experiment:
- Fix the reusable material. Choose one document version and one instruction block. Keep their text and ordering unchanged for the comparison. Append each new question after the document rather than placing it before the reusable content.
- Send several legitimate questions about that same material. Record request order and timing, the document version, prompt-template version, and the requested model identifier
deepseek-flash. Keep the endpoint explicit so results are not silently pooled with another provider’s route. - Record both usage counters per response.
prompt_cache_hit_tokenscounts input tokens that hit the cache;prompt_cache_miss_tokenscounts input tokens that did not. Inspect the sequence, not just the second response. - Interpret misses conservatively. An early miss is consistent with a prefix that has not yet been persisted as a reusable unit. Continued misses mean the proposed reuse has not been demonstrated in those requests—not that identical text guarantees a benefit the counters somehow failed to show.
The baseline is the initial request sequence, before reuse has been demonstrated. No hit-rate target is implied. Keeping prompt and document versions alongside the counters makes later comparisons interpretable: a changed prefix and an unchanged prefix are different conditions.
What not to optimize away
The guide says unused caches are usually cleared within hours to days; it does not offer a fixed retention guarantee. Keep the full required context in requests rather than treating prior submission as a durable document handle.
Also, prefix caching is not answer caching. The guide says outputs are still generated through computation and inference. Cache-hit tokens therefore do not establish answer consistency, retrieval recall, or factual accuracy. Do not retain stale document content merely to preserve a reusable prefix.
For this V4.1-Flash workflow, the decision is modest: organize genuinely reusable document context as a stable leading prefix, but accept a cache benefit only when the direct API’s counters show it. The sources support that layout and measurement choice; they do not supply measured latency, savings, or corpus-quality results.