CloudFront can serve an older file even after its origin has changed. Creating an invalidation makes CloudFront fetch selected objects again from the origin on the next request after the invalidation completes.

Invalidation removes cached copies from CloudFront without deleting the files at the origin. It does not clear a visitor's browser cache, a corporate proxy cache, or an application cache at the origin, so the origin must already return the updated content.

The AWS console requires access to the account that owns the distribution and permission to create invalidations (cloudfront:CreateInvalidation), which an account administrator can grant.

Steps to clear the CloudFront cache in the AWS console:

  1. Open CloudFront from the AWS Management Console.

    The CloudFront console also opens the service directly. The screenshots show an older console layout; labels and positions may differ in the current console.

  2. Choose the distribution that serves the affected website.

    The distribution's domain name, alternate domain names, and origin identify the website whose cached objects will be removed.

  3. Select the Invalidations tab.
  4. Choose Create invalidation.
  5. Enter one invalidation path per line for the objects to refresh.

    Paths are relative to the distribution, case sensitive, and contain no hostname. An exact path such as /images/logo.png refreshes that object. A trailing wildcard such as /images/* refreshes every object under that directory, including subdirectories. The path /* refreshes all objects in the distribution. If query strings produce separate cached versions, a trailing wildcard such as /images/logo.png* covers them together.

    An invalidation cannot be canceled after submission. A full-distribution invalidation causes later requests for previously cached objects to return to the origin, increasing origin load. On pay-as-you-go pricing, the first 1,000 invalidation paths per month are free across all distributions in the AWS account; additional paths are charged. A wildcard counts as one path regardless of the number of matching objects.
    Related: CloudFront pay-as-you-go pricing

  6. Choose Create invalidation to submit the request.

    The pictured /* path refreshes every object in the distribution; a narrower path is usually better when only specific objects have changed.

  7. Wait until the invalidation's Status is Completed.
  8. Reload the changed object's public URL with your browser cache bypassed to see your change.

    The website address or the distribution's cloudfront.net domain goes through CloudFront; a direct origin URL does not. Old content after completion can indicate a missed path or query-string variant, the wrong distribution, or another cache at the browser or origin.

Share this guide