Amazon CloudFront
Developer Guide (API Version 2010-11-01)
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...

Object Expiration

An object stays in an edge location until it expires. After the object expires, CloudFront must go back to the origin server the next time that edge location needs to serve that object. By default, all objects automatically expire after 24 hours.

You can specify a longer expiration time by using the Cache-Control, Pragma, or Expires header on the object in the origin server. How you set the headers depends on the particular tool you're using to work with objects in Amazon S3. Consult the tool's documentation for help. For more information about the headers themselves, go to the RFC 2616 specification. The RFC 2616 specification might recommend maximum values for the headers; however, CloudFront does not restrict their maximum values.

The minimum expiration time you can specify is one hour. If you specify a minimum time of less than one hour, CloudFront uses one hour.

When CloudFront serves an object to an end user, the headers and your settings get passed along with the object to the end user.

[Note]Note

The settings passed to the end user are the values you set, even if those settings are for expiration durations of less than one hour.

The end user cannot use the HTTP Cache-Control, Pragma, If-Modified-Since, or Expires headers in the GET request to force CloudFront to go back to the origin server for the object. CloudFront ignores those headers from the end user.