Posted On: May 21, 2015
Amazon CloudFront’s invalidation feature, which allows you to remove an object from the CloudFront cache before it expires, now supports the * wildcard character. You can add a * wildcard character at the end of an invalidation path to remove all objects that match this path. In the past, when you wanted to invalidate multiple objects, you had to list every object path separately. Now, you can easily invalidate multiple objects using the * wildcard character.
Using the * wildcard character in the invalidation path is useful for many use cases. For example, if you're doing a new deployment, you can now just use /* to invalidate the entire distribution. Similarly, if you want to invalidate all objects for a specific end user, you can invalidate the content in a directory, for example, /enduser-x-data/*.
This new capability can also help you lower your cost of invalidating multiple objects. Invalidation paths that include the * wildcard (representing multiple objects) incur the same charge as an invalidation path that represents a single object. As before, the first 1,000 invalidation paths each month are provided at no additional charge and above this level, there is a $0.005 charge per invalidation path. But now you pay $0.005 for the /directory-name/* invalidation path even if this path matches thousands of objects. For more information on invalidation pricing, see Amazon CloudFront Pricing.
You can read more about the invalidation feature in the Amazon CloudFront Developer Guide. We will also demonstrate this functionality in our next CloudFront office hours on Wednesday, June 17th. You can sign-up for this office hours session here.