Why does Gemini 3.1 Flash-Lite only cache 2,088 tokens out of a repeated 5,500-token prompt?

Hi everyone,

I’m trying to understand the implicit caching behavior of Gemini 3.1 Flash-Lite when sending identical requests multiple times.

Test environment

  • Model: gemini-3.1-flash-lite

  • API: Gemini Developer API

  • Request type: Stateless

  • Input prompt length: Approximately 5,500 tokens

  • Requests: Multiple consecutive requests with exactly the same prompt

Observed behavior

When I send the exact same 5,500-token prompt multiple times, the API reports:

cached_content_token_count: 2088

I expected that after the first request, subsequent identical requests would reuse most, if not nearly all, of the previously processed input tokens.

However, only approximately 2,088 tokens are reported as cached, while the remaining 3,400+ tokens appear to be processed as regular input.

My questions: Why does Gemini only cache 2,088 tokens when the entire 5,500-token prompt is identical across requests?

I understand that implicit caching is not guaranteed for every request. However, in this test, the prompt is identical across multiple requests, and the cached token count consistently raises questions about how much of the input is actually being reused.

Could someone clarify why only 2,088 out of approximately 5,500 identical input tokens are cached?

Thank you.

Hello @Tu_n_Ki_t1,

  • Implicit caching is enabled by default with no cost saving or full-prompt coverage guarantee, so cached_content_token_count: 2088 reports the prefix portion served from the implicit cache while the remaining tail tokens are re-processed as standard input.
  • To guarantee that the entire ~5,500-token prompt is cached and reused across requests on gemini-3.1-flash-lite, create an explicit cache using client.caches.create (CreateCachedContentConfig) and pass cached_content=cache.name in GenerateContentConfig per the Explicit caching guide.