‹ All AI-103 questions

AI-103 Practice Question 37: Prompt Caching Prefix

Microsoft Azure AI Apps and Agents Developer Associate (AI-103) · Test 4 · question 7 of 10

Implement generative AI and agentic solutionshard

A support assistant sends a 4,000-token system message (product catalogue and answering policy, unchanged for months) on every request. To help the model with relative dates, the application prefixes each system message with a line reading Current time: 2026-05-12T09:41:07Z, then appends the user's question. Costs are high and latency is poor, and every response reports cached_tokens as 0 even under steady traffic.

What should the team change?

Select one answer
Show answer and explanation

Answer:

  • C. Put the unchanged catalogue and policy text first, and move the timestamp and the user's question to the end of the prompt

Prompt caching has two entry conditions: the prompt must be at least 1,024 tokens, and the first 1,024 tokens must be identical between requests. A second-resolution timestamp at the very top changes the prefix on every single call, and Microsoft is explicit that "a single character difference in the first 1,024 tokens results in a cache miss, which is characterized by a cached_tokens value of 0", the symptom reported here. The documented best practice is the fix: place stable or repeated content at the beginning of the prompt and dynamic content at the end.

- A is wrong because retention controls how long a cached prefix survives, not whether one is ever written. With a prefix that never repeats there is nothing for a longer lifetime to preserve. - B is wrong because caching is already enabled by default on supported models; the prompt shape, not the deployment type, is the problem. (Provisioned deployments do get a larger cache read discount, but they also don't support prompt cache breakpoints.) - D is wrong and would make things worse: a prompt shorter than 1,024 tokens is not cacheable at all, so trimming the system message below the threshold removes the only chance of a hit.

Reference: Prompt caching with Azure OpenAI in Microsoft Foundry Models

Practice Test 4 ›

Study guides for AI-103

AI engineer roadmap 2026: skills, certs and the orderAI engineer roadmap for 2026: skills to learn in order, AI engineer vs ML engineer, which certifications fit each stage, and what to skip.
AI-200 exam guide: Azure AI Cloud Developer AssociateAI-200 replaced AZ-204: what the Azure AI Cloud Developer exam tests, how it differs from AI-103, price in USD and INR, format and how to prepare.
How AI Is Changing Software Jobs: Where to PrepareHow AI is changing software jobs: what history shows, the evidence on junior developers, what Klarna learned, new AI roles and five domains to prepare for.
AI-901 exam guide: Azure AI Fundamentals after AI-900AI-901 replaced AI-900: learn what changed, how much Python and Microsoft Foundry you need, exam costs in India, and how to prepare.
Best AI certifications 2026: AWS, Google, Microsoft, ClaudeThe best AI certifications in 2026 from AWS, Google, Microsoft, Claude and Databricks, by level, with price, status and which one to take first.
Microsoft AI certification path 2026: which exam firstMicrosoft AI certification path for 2026 - AI-901, AB-730, AI-103, AI-200, AI-300, AB-100, AI-500 and GH-300 by role, and which exam to take first.
AI-103 Certification Guide: What Changed From AI-102The AI-103 certification replaced AI-102 in 2026. Exam format, cost, the five skill domains, what changed and how to prepare, with free practice questions.
What Is RAG? How Retrieval-Augmented Generation WorksWhat RAG is and how it works: chunking, embeddings, vector search, hybrid search, reranking, GraphRAG and agentic RAG on AWS, Google and Azure.
Prompt engineering vs RAG vs fine-tuningWhen to use prompt engineering, retrieval-augmented generation, fine-tuning or continued pre-training, compared on cost, freshness, hallucination and privacy.