In AWS CloudFront you have 216 edge locations as I mentioned previously. Well each of these edge location costs money for how much data you’re exporting, some edge locations cost more than others. So how do we control the pricing while maintaining a wide range of edge locations around the world? That’s where price classes come in! There are 3 in total, first off we have price class all, this price class includes all edge locations and provides the highest performance for the highest cost. Next up we have price class 200, this is very close to all but it removes the more expensive edge locations. Finally we have price class 100, this only includes the least expensive edge locations. Now onto the concept of cache invalidation. So let’s say you add an image to /images on your bucket, you want users accessing through CloudFront to see that right away. However, the old /images group is already cached and it will not be updated again until TTL expires. What we can do is perform a cache invalidation and that will reset the TTL automatically in this case it would be for /image/* and if you’re running a web server you can even specify the index.html file. You perform this invalidation directly on the distribution in CloudFront in the AWS Management Console. In short price classes are a great way to control cost in CloudFront and cache invalidation is a great way to force CloudFront to recache your origin in the event you need to make an update. As always if you have any questions please feel free to leave a comment below!