In CloudFront, we have the ability to control the behavior of the distribution we create in several different ways. We can decide what kinds of HTTP request methods we allow to be forwarded to our distribution. We can select three types of requests to be forwarded:
- GET and HEAD: Used for static content caching, such as media and static websites.
- GET, HEAD, and OPTIONS: Used for static content on servers that have several communication options enabled.
- GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE: Used for caching and terminating dynamic HTTP sessions at the CloudFront Edge Location. This allows us to speed up the write requests to our backend API or WebSockets environment.
We can also control the time-to-live (TTL) of our cache by controlling the CloudFront distribution options. This allows us to automatically expire content and give the environment the ability...