Serverless Developer Guide
• Non-proxy custom integrations can transform data before it gets to your integration service 
and before the output is sent to clients. For Lambda, your function code can focus on the 
business task rather than parsing data in the input event. Non-proxy can be a good ﬁt for legacy 
code migrations too, because you can transform the data to match expectations of existing code.
Related resource(s):
• Tutorial: Build a Hello World REST API with Lambda proxy integration (proxy example)
• Using API Gateway as a proxy for DynamoDB (custom non-proxy integration example)
• Best practices for working with Apache Velocity Template Language (VTL) (custom non-proxy 
integration example)
Optimize your API with caching (REST API only)
To reduce the number of calls made to your endpoint and improve the latency of requests to your 
API, you can cache responds from your endpoint for a speciﬁed time-to-live period. API Gateway 
will respond to the request by using the cache instead of your end point. This can speed up your 
latency.
Related resource(s):
• Enabling API caching to enhance responsiveness - Learn how to enable caching for your REST 
APIs.
Send binary media types
You can use either REST APIs or HTTP APIs to send binary payloads such as a JPEG or gzip ﬁle. For 
REST APIs, you need to take additional steps to handle binary payloads for non-proxy integrations.
Related resource(s):
• Return binary media from a Lambda proxy integration - Learn how to use a Lambda function to 
return binary media. This works for both REST and HTTP APIs.
• Working with binary media types for REST APIs - Additional considerations for REST non-proxy 
integrations
Advanced Topics 69