Amazon CloudFront
API Reference (API Version 2012-05-05)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

InvalidationBatch Complex Type

Description

The InvalidationBatch complex type describes the invalidation batch. For more information about invalidation, go to Object Invalidation in the Amazon CloudFront Developer Guide.

This complex type is a request element in POST Invalidation, and is a response element in GET Invalidation List and GET Invalidation.

Syntax

<InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2012-05-05/">
   <Paths>
      <Quantity>number of objects to invalidate</Quantity>
      <Items>
         <Path>path to object to invalidate</Path>
      </Items>
   </Paths>
   <CallerReference>unique identifier for this invalidation batch</CallerReference>
</InvalidationBatch>

Elements

The following table describes the child elements in the InvalidationBatch datatype.

NameDescription

Paths

A complex type that contains information about the objects that you want to invalidate.

Type: Complex

Default: None

Children: Quantity, Items, CallerReference

Parent: InvalidationBatch

Quantity

The number of objects that you want to invalidate.

Type: Integer

Default: None

Parent: Paths

Items

A complex type that contains a list of the objects that you want to invalidate.

Type: Complex

Default: None

Children: Path

Parent: Paths

Path

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

CallerReference

A value that you specify to uniquely identify an invalidation request. CloudFront uses the value to prevent you from accidentally resubmitting an identical request. Whenever you create a new invalidation request, you must specify a new value for CallerReference and change other values in the request as applicable. One way to ensure that the value of CallerReference is unique is to use a timestamp, for example, 20120301090000.

If you make a second invalidation request with the same value for CallerReference, and if the rest of the request is the same, CloudFront doesn't create a new invalidation request. Instead, CloudFront returns information about the invalidation request that you previously created with the same CallerReference.

If CallerReference is a value you already sent in a previous invalidation batch request but the content of any Path is different from the original request, CloudFront returns an InvalidationBatchAlreadyExists error.

Type: String

Default: None

Constraints: Allowable characters are any Unicode code points that are valid in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Examples

Example of an invalidation batch request

The following example invalidation batch request is for invalidation of two image objects and a Flash movie object.

<InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2012-05-05/">
   <Paths>
      <Quantity>3</Quantity>
      <Items>
         <Path>/image1.jpg</Path>
         <Path>/image2.jpg</Path>
         <Path>/videos/movie.flv</Path>
      </Items>
   </Paths>
   <CallerReference>20120301090001</CallerReference>
</InvalidationBatch>