Bite-Sized Serverless

CloudFront Icon

Cache Control with CloudFront Functions

CloudFront - Advanced (300)

Asset caching is an essential component for fast and efficient websites. Caching allows browsers and content distribution networks (CDNs) to locally store a copy of an asset, such as an image or a javascript file. The next time a user requests the same asset, it can be served from the local cache instead of the origin. This improves loading speed and user experience, while reducing stress on the origin. In this Bite we will cover how we can configure and instruct our CDNs and browsers to optimally cache our assets. We will use CloudFront behaviors to configure the CDN and CloudFront Functions to add HTTP caching headers.