Senior Software Engineer
Varshit is a Senior Software Engineer with over five years of experience in DevOps and Platform Engineering.
In today's cloud-native landscape, API gateways play a critical role in serverless and microservices architectures. This is a powerful tool for building scalable APIs, but it's also easy to overlook the cost-effectiveness, especially if the APIs are frequently called or redundant. For FinOps practitioners who are sure to focus on reducing costs without compromising, the use of API Gateways integrated with a cache is a game-changer.
Amazon API Gateway provides integrated response caching, interfering with edge layer endpoints, eliminating the need to access back-end services (such as Lambda, EC2, RDS) for each request.
Here’s how it works:
1. Reduce Backend Invocation Costs
Back-end views (such as Lambda or RDS calls) often incur the majority of API-related costs. These calls are avoided in intermediate storage if the same query from the cache is being operated on.
2. Control Data Transfer Charges
Output data transmission (especially for large payloads) is reduced, leading to savings in data transmission costs (DTO).
3. Enhance User Experience
Faster response times and lower latency mean you don’t need to scale up infra (saving both cost and operational effort).
Suppose you want to run the Product Catalog API for your e-commerce platform. To retrieve the product listings.
Without caching:
With Caching Enabled:

Multiplying this by multiple APIs can save thousands of dollars each year.
Step 1: Open the API Gateway Console
Sign in to the AWS Management Console and navigate to Amazon API Gateway. Select the REST API where you want to enable caching.
Step 2: Select the Deployment Stage
From the left navigation pane, choose Stages, then select the deployment stage (for example, dev, staging, or production) where caching should be enabled.
Step 3: Enable the Cache Cluster
Click Edit in the Stage details section.
Under Cache Settings:
Step 4: Configure Method-Level Caching
Enable Default Method-Level Caching to cache responses for eligible GET methods. By default, API Gateway caches only GET requests.
You can also configure cache key parameters so that requests with different parameter values generate separate cache entries.
Example Request

Cache Key

Requests such as GET /users?type=regular are cached separately because the type query parameter is included in the cache key.
Note: If you have an existing setting for a method-level cache, changing the default method-level caching setting doesn't affect that existing setting.

Step 5: Save the Configuration
Choose Save Changes to provision the cache cluster. Creating or deleting a cache cluster can take up to four minutes. Once the cache status changes to Active, monitor cache performance using Amazon CloudWatch metrics such as CacheHitCount and CacheMissCount to verify that caching is working as expected.
Pro Tip:
Use stage variables to toggle caching across environments without redeploying code.


API Gateway provisions a dedicated cache cluster for each deployment stage. Selecting the appropriate cache size depends on your API traffic, response payload size, and expected cache hit ratio.

Note: Pricing may vary by AWS Region. Refer to the official AWS API Gateway Pricing page for the latest pricing.
Ideal For
Avoid Caching When
API Gateway caching may not be suitable for every workload. Avoid enabling caching in the following scenarios:

API Gateway Caching is one of the easiest ways to reduce costs and improve performance. Doing more in less amounts. If you're managing serverless APIs or want to advise your team on cost strategies, put caching in your roadmap today.