DVA-C02 Development with AWS Services Practice Question
A company uses Amazon API Gateway with a Lambda authorizer to control access to its APIs. The Lambda authorizer returns an IAM policy that grants access to the API. Recently, the company noticed that some API calls are being throttled due to high latency from the authorizer. What is the MOST effective way to reduce latency?
⚠ Common exam trap
Many exam-takers assume increasing Lambda memory (Option D) is the universal fix for Lambda performance issues, but in this context the latency stems from the invocation overhead and network round-trip, not from CPU-bound processing, making caching the more effective solution.
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
✓
Enable caching for the Lambda authorizer responses.
Enabling caching for the Lambda authorizer responses allows API Gateway to reuse the IAM policy returned by the authorizer for subsequent requests that match the same cache key, without invoking the Lambda function again. This eliminates the latency of the authorizer invocation on cache hits, directly addressing the throttling caused by high authorizer latency.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Enable caching for the Lambda authorizer responses.
Why this is correct
Enabling caching for Lambda authorizer responses significantly optimizes API Gateway performance and cost. Once an authorizer successfully authenticates a request and returns a policy, API Gateway stores this decision for a configurable duration. Subsequent requests with the same identity source within the cache's Time-To-Live (TTL) period will bypass the Lambda authorizer invocation entirely, drastically reducing latency and Lambda execution costs.
- ✗
Use a custom authorizer instead of a Lambda authorizer.
Why it's wrong here
The term 'custom authorizer' in API Gateway refers to the general capability of implementing custom authorization logic, for which the Lambda authorizer is the specific, supported mechanism. API Gateway does not offer an alternative, non-Lambda-based 'custom authorizer' type. Therefore, suggesting to switch to a generic 'custom authorizer' instead of a Lambda authorizer is a misinterpretation of API Gateway's authorization model and not a viable solution.
- ✗
Reduce the TTL of the authorizer cache.
Why it's wrong here
Reducing the Time-To-Live (TTL) of the authorizer cache would directly lead to more frequent invocations of the Lambda authorizer function. A shorter TTL means cached authorization decisions expire sooner, forcing API Gateway to re-invoke the authorizer for requests that would otherwise have been served from the cache. This action would increase latency, operational costs, and the load on the Lambda function, directly counteracting the goal of optimization.
- ✗
Increase the memory allocated to the Lambda authorizer function.
Why it's wrong here
While increasing the memory allocated to a Lambda authorizer function can improve its execution speed for computationally intensive tasks, it does not address the fundamental issue of repeated invocations. The primary performance bottleneck for authorizers is often the overhead of invoking the function for every request, not necessarily the execution time of the Lambda itself. Caching directly prevents these redundant invocations, offering a more impactful solution than simply making each individual invocation slightly faster.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services 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 DVA-C02 exam.