sajal / Cloudfront-Purge-Tool

Easily purge (invalidate) files from Amazon Cloudfront, using an intuitive, secure interface.
http://www.cdnplanet.com/tools/cloudfront-purge-tool/
35 stars 5 forks source link

Purge all assets #2

Closed thomasklemm closed 12 years ago

thomasklemm commented 12 years ago

Hey @sajal,

is /* the preferred or at least or working way for pruging all assets or is there a better way?

Thanks for your help in advance.

Thomas

sajal commented 12 years ago

Hi, Purge all assets does not work.

Cloudfront does provide an API to purge all (or purge directory), so we cant implement it in our tool.

http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/InvalidationBatchDatatype.html

The path of the object to invalidate. The path is relative to the distribution and must begin with a slash (/). For example, to invalidate the object at http://d111111abcdef8.cloudfront.net/images/image2.jpg, you would specify:

<Path>/images/image2.jpg</Path>.

You must enclose each invalidation object with the Path element tags.

To invalidate the default root object, specify the path to the object the same way you specify the path to any other object.

You can make any number of invalidation requests, but you can have only three invalidation requests per distribution in progress at one time. Each request can contain up to 1,000 objects to invalidate. If you exceed these limits, CloudFront returns an error message. To determine how many invalidation batches are currently in progress, run GET Distribution and see the value of the InProgressInvalidationBatches element.

If the object is a directory and if you have not standardized on a method for specifying directories—with or without a trailing slash (/)—we recommend that you invalidate the directory both with and without a trailing slash, for example, images and images/. For more information, go to How Public URLs Affect the Invalidation of Directories in the Amazon CloudFront Developer Guide.

If the path includes non-ASCII characters or unsafe characters as defined in RFC 1783 (http://www.ietf.org/rfc/rfc1738.txt), URL encode those characters. Do not URL encode any other characters in the path, or CloudFront will not invalidate the old version of the updated object.

Type: String

Default: None

Constraints: Maximum 4,000 characters

Clearly shows that each path represents single object. Until that changes we are helpless..

-Sajal

thomasklemm commented 12 years ago

Hey Sajal,

thanks a lot for this detailed answer! Hope the Amazon Guys will add such an option in the near future...

Thomas