AZ-204 Develop Azure compute solutions Practice Question
You are developing an API using Azure API Management (APIM). The API is backed by an Azure Function that processes requests. You need to implement caching for responses that are expensive to compute. The cache should expire after 10 minutes. What should you configure in APIM?
⚠ Common exam trap
Candidates often assume an external cache like Redis is required for any caching in APIM, but the built-in cache-lookup and cache-store policies use APIM's internal cache by default, making external Redis optional and only needed for advanced scenarios like multi-region deployments or higher cache capacity.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add a cache-lookup and cache-store policy to the API operation.
Azure API Management (APIM) provides built-in caching policies—`cache-lookup` and `cache-store`—that can be applied directly to an API operation. These policies cache the response from the backend (the Azure Function) and respect the `cache-control` header or a specified duration, such as 10 minutes, without requiring an external cache. This is the simplest and most direct way to implement response caching for expensive-to-compute operations within APIM.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure Azure Redis Cache as an external cache in APIM.
Why it's wrong here
While Azure API Management (APIM) can be configured to use external caches like Azure Redis Cache, it is generally an over-engineered solution for basic API response caching within a single APIM instance. The built-in caching mechanisms provided by APIM are typically sufficient and simpler to implement for common scenarios, making Redis unnecessary unless specific advanced requirements for distributed or very large-scale caching exist.
- ✓
Add a cache-lookup and cache-store policy to the API operation.
Why this is correct
Adding `cache-lookup` and `cache-store` policies directly to an API operation is the standard and most effective method for implementing response caching within Azure API Management. These policies leverage APIM's highly optimized, built-in cache, allowing the gateway to check for cached responses before forwarding requests and to store backend responses for subsequent requests, centralizing cache management at the API gateway level.
- ✗
Implement response caching in the Azure Function code.
Why it's wrong here
Implementing response caching directly within the Azure Function code shifts the caching responsibility away from the API gateway, leading to a less centralized and potentially fragmented caching strategy. This approach makes it more difficult to apply consistent caching rules across multiple APIs, manage cache invalidation, and monitor caching effectiveness from a single control plane like APIM.
- ✗
Use Azure Front Door to cache responses.
Why it's wrong here
Azure Front Door is primarily designed as a global load balancer, Web Application Firewall (WAF), and Content Delivery Network (CDN) for web applications, optimizing traffic routing and content delivery at the edge. While it offers caching capabilities, its focus is typically on static content or full web pages, not the granular, API-specific response caching that Azure API Management is specifically built to handle for backend APIs.
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.