Connect to and consume Azure services and third-party services →mediumMultiple ChoiceObjective-mapped
AZ-204 Practice Question: Connect to and consume Azure services and third-party services
An application uses Azure Redis Cache to improve performance. The team notices that cache misses are high and the cache is not effectively reducing database load. What should they do to improve cache hit ratio?
⚠ Common exam trap
Many candidates confuse cache misses caused by expiration (TTL too short) with cache misses caused by memory pressure (evictions), leading them to incorrectly choose increasing cache size or changing eviction policy instead of adjusting TTL.
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
✓
Increase the time-to-live (TTL) for cached items
High cache misses often indicate that cached data is expiring too quickly, forcing the application to fetch data from the database. Increasing the time-to-live (TTL) for cached items keeps frequently accessed data in the cache longer, directly improving the cache hit ratio. This is the most straightforward fix when the cache is underutilized due to premature eviction, not because of capacity or policy issues.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the cache size
Why it's wrong here
Increasing the cache size provides more storage capacity but does not inherently improve the cache hit ratio if the existing items are expiring too quickly or the application's caching strategy is inefficient. If the working set of frequently accessed data is already smaller than the current cache size, or if data churn is high due to short Time-To-Live (TTL) values, a larger cache will simply contain more expired or infrequently accessed data without reducing misses.
- ✓
Increase the time-to-live (TTL) for cached items
Why this is correct
Increasing the Time-To-Live (TTL) for cached items directly improves the cache hit ratio by ensuring data remains in the cache for a longer duration. When an item's TTL is extended, it reduces the likelihood of that item expiring and being removed from the cache, thereby preventing subsequent requests for the same data from resulting in a cache miss and a slower fetch from the origin data store. This directly addresses the problem of items being removed prematurely.
- ✗
Implement cache-aside pattern with manual invalidation
Why it's wrong here
Implementing a cache-aside pattern with manual invalidation introduces significant operational complexity and potential for errors that can negatively impact the hit ratio. If manual invalidation is performed too aggressively, too early, or incorrectly, it can prematurely remove valid data from the cache, leading to an increase in cache misses. While cache-aside is a fundamental pattern, manual invalidation is primarily concerned with data consistency rather than directly improving the hit ratio, and its implementation can easily degrade performance if not meticulously managed.
- ✗
Change the eviction policy to allkeys-lfu
Why it's wrong here
Changing the eviction policy to `allkeys-lfu` (Least Frequently Used) primarily affects which items are removed *when the cache is full*. If the cache is not consistently reaching its capacity limits, or if items are expiring due to their Time-To-Live (TTL) before an eviction policy would even be triggered, then altering the eviction strategy will have minimal impact on the overall cache hit ratio. The problem might be related to how long items are *allowed* to live, rather than which items are *forced* out due to space constraints.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.