Courseiva
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 API Gateway HTTP API Practice Question

A developer is building a RESTful API using Amazon API Gateway (REST API) and AWS Lambda. The API receives a large number of requests with duplicate payloads within a short time window. To improve performance and reduce costs, the developer wants to ensure that if the same request (based on a unique client ID) is sent within 5 minutes, the Lambda function is not invoked again, and the previously calculated response is returned. Which API Gateway feature should the developer use?

⚠ Common exam trap

Candidates might confuse this with HTTP APIs, which do not support native caching. The question specifies a REST API, making caching a valid feature. Also, ensure the cache key is configured correctly to avoid returning incorrect cached responses.

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 API caching on the stage with a TTL of 300 seconds and configure the client ID as a cache key parameter.

Amazon API Gateway (REST API) supports response caching at the stage level. By enabling API caching with a TTL of 300 seconds (5 minutes) and specifying the client ID as a cache key parameter, identical requests with the same client ID within the TTL will return the cached response without invoking the Lambda function. This reduces latency and cost.

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 API caching on the stage with a TTL of 300 seconds and configure the client ID as a cache key parameter.

    Why this is correct

    API Gateway's built-in caching mechanism is exclusively available for REST APIs, not HTTP APIs. While enabling caching on a stage with a specified TTL and using a client ID as a cache key parameter is a valid strategy for optimizing REST API performance and reducing backend load, this functionality is simply not supported for HTTP APIs. Therefore, this option cannot be implemented for the API type specified in the question, rendering it ineffective for the stated goal.

  • Enable request validation to reject duplicate requests.

    Why it's wrong here

    API Gateway's request validation feature is used to ensure that incoming request bodies, headers, or query parameters conform to a predefined JSON schema model. Its primary purpose is to enforce data integrity and prevent malformed requests from reaching backend integrations, returning a 400 Bad Request error if validation fails. This validation process strictly checks the format and structure of the request against a model, but it lacks the capability to identify or reject logically "duplicate" requests based on their content or to serve cached responses.

  • Configure a usage plan with a throttle rate to limit requests from each client.

    Why it's wrong here

    A usage plan with a configured throttle rate effectively limits the number of requests a client can make to an API over a specified period, preventing abuse and protecting backend services from overload. However, its function is solely to enforce rate limits, rejecting requests that exceed the defined thresholds with a 429 Too Many Requests HTTP status code. This mechanism does not involve storing or returning previously computed responses; it strictly controls access rates rather than optimizing response delivery for repeated requests.

  • Enable stage variables to store the previous response.

    Why it's wrong here

    Stage variables in API Gateway are designed for dynamic configuration values, such as endpoint URLs, API keys, or environment-specific settings, which can be referenced in integration requests or mapping templates. They are static key-value pairs defined at the stage level and are not intended for, nor capable of, storing dynamic data like previous API responses. Their purpose is to manage deployment-specific configurations, not to implement caching or stateful response storage.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on DVA-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A developer is building a RESTful API using Amazon API Gateway. The API experiences high traffic spikes, and many requests are for the same data (e.g., a product catalog). The developer wants to reduce the load on the backend Lambda functions and improve response times for repeated requests. Which feature should the developer enable?

easy
  • A.Enable API Gateway caching and set a TTL.
  • B.Use CloudFront with the API Gateway as an origin.
  • C.Enable throttling on the API Gateway usage plan.
  • D.Use a DynamoDB Accelerator (DAX) cluster for the backend database.

Why A: API Gateway caching stores responses from backend Lambda functions for a configurable time-to-live (TTL). When a request for the same data (e.g., a product catalog) arrives within the TTL period, API Gateway serves the cached response directly, reducing the number of invocations to the Lambda function and improving response latency. This directly addresses the need to reduce load on the backend and improve response times for repeated requests.

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.