Prompt cache works just for text

I experience an issue with prompt caching on Azure OpenAI where any request containing an image_url content block silently disables caching (cache_write_tokens=0), while text-only requests cache correctly.

I’ve used the raw OpenAI Python SDK (with_raw_response.create()) to bypass LangChain entirely and read usage.prompt_tokens_details directly. Each test sends two identical requests with the same prompt_cache_key and prompt_cache_options: {mode: “explicit”, ttl: “30m”}.

What I’ve tested :

  • cache_write_tokens=0 on Call 1 — Azure refuses to write to cache, not just to read
  • The block fires on the “type”: “image_url” / “type”: “input_image” content block type, regardless of image format (PNG/JPEG), encoding (base64/URL), size (1px to full photo), or API endpoint (Chat Completions vs Responses API)
  • Sending the identical base64 data as “type”: “text” (Test J) caches fine — confirming the gate is on content block type detection, not on the actual data

Is multimodal prompt / image caching disabled somehow at the deployment or subscription level? Documentation explicitly state images are cacheable. Is there a setting that needs to be enabled, or is there something I don’t understand?

1 Like