AWS News Blog

Simplified Multiple Object Invalidation for Amazon CloudFront

Voiced by Polly

Many AWS customers use Amazon CloudFront to deliver content to end users at high data transfer speed with low latency. Because CloudFront has no minimum usage commitment, it is a good fit for web properties of any size.

Each CloudFront edge location caches recently used objects in order to deliver dynamic, static, streaming, or interactive content as expeditiously as possible. CloudFront also allows you to invalidate (remove) an object from the cache before it expires. For example, if you upload a new CSS file for your website, invalidating the file will ensure that your users will see the update the next time they visit the site.

Multiple Object Invalidation
We recently enhanced CloudFront’s invalidation feature by adding support for wildcard invalidations. You can now add a “*” character to the end of an invalidation path to remove all objects that match the path. Wildcard invalidations take no more time than those for individual objects, and can invalidate an unlimited number of objects.

Wildcard invalidation can be of value in many different situations. If you are deploying a new version of your website or web application, you can invalidate the existing content using “/*”. If your content is organized by user name, you can invalidate it using a pattern that looks like “/users/jeffbarr-data”. As you can imagine, wildcard invalidation is often easier to implement. It can also be more cost-effective (see Cost Savings, below).

You can access this feature from the AWS Management Console, AWS Command Line Interface (AWS CLI), AWS Tools for Windows PowerShell, and via CloudFront’s Invalidation API. Here is how you would invalidate multiple objects from the Console:

We also enhanced the limits on invalidation, so you now can have up to 3000 invalidation objects per distribution in progress at one time. This can be one invalidation request for up to 3,000 objects, up to 3,000 requests for one object each, or any other combination that doesn’t exceed 3,000 objects. In addition, you can submit up to 15 invalidation paths that include the “*” wildcard character at one time per distribution. For information about limits on invalidations, see Invalidation Limits.

Cost Savings
You can invalidate up to 1,000 paths per month at no charge when you use CloudFront (each additional invalidation path costs $0.005). An invalidation path that includes the “*” character incurs the same charge as one that does not. You pay for one invalidation path, even if the path matches hundreds or thousands of objects. See the CloudFront Pricing page for more information.

Office Hours
The CloudFront team is planning to demonstrate this new feature at the next CloudFront Office Hour (June 17th, 2015).

Jeff;

Modified 2/11/2021 – In an effort to ensure a great experience, expired links in this post have been updated or removed from the original post.
Jeff Barr

Jeff Barr

Jeff Barr is Chief Evangelist for AWS. He started this blog in 2004 and has been writing posts just about non-stop ever since.