In this recipe, we'll show you how to use AWS CloudFront to cache your website.
The primary reasons you'll want to consider doing this are as follows:
- Copies of your content will be geographically located closer to your end users, thus improving their experience and delivering content to them faster.
- The burden for serving content will be removed from your fleet of servers. This could potentially result in a large cost saving if you're able to turn off some servers or reduce your bandwidth bill.
- You may need to be shielded from large and unexpected spikes in traffic.
- While not the focus of this chapter, CloudFront gives you the ability to implement Web Application Firewall (WAF) as an added layer of protection from the bad guys.
Unlike most AWS services, which are region specific, CloudFront is a global service.