Managing how long content stays in the cache (expiration)

  • You can control how long your files stay in a CloudFront cache before CloudFront forwards another request to your origin.

  • Reducing the duration allows you to serve dynamic content.

  • Increasing the duration means that your users get better performance because your files are more likely to be served directly from the edge cache.

  • The Cache-Control max-age directive lets you specify how long (in seconds) that you want an object to remain in the cache before CloudFront gets the object again from the origin server.

  • For example, the following directive tells CloudFront to keep the associated object in the cache for 3600 seconds (one hour): Cache-Control: max-age=3600

Last updated

Was this helpful?