Answers.Body: <p>One way would be to manually clear it with <a href="https://superbig.co/plugins/cloudfront-invalidation" rel="nofollow noreferrer">Cloudfront Invalidation</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-13T09:29:10.990Z
Answers.Text: Is there another option for Craft 3?
Answers.UserDisplayName: Javier García
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-22T11:53:41.953Z
Answers.Text: I believe its built in to the S3 plugin?
Answers.UserDisplayName: Fred Carlsen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T15:55:08.330Z
Answers.LastActivityDate: 2017-06-09T15:55:08.330Z
Answers.UserDisplayName: Fred Carlsen
Answers.Body: <p>Your best option for Craft 3 is to use <a href="https://putyourlightson.com/plugins/blitz" rel="nofollow noreferrer">Blitz</a> and the <a href="https://github.com/putyourlightson/craft-blitz-cloudfront" rel="nofollow noreferrer">Cloudfront Blitz Plugin</a>.</p>
  <p>This combination will allow your craft instance to automatically expire CloudFront caches as needed, or clear the entire CloudFront cache from the CraftCMS CP.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-16T15:56:59.047Z
Answers.Text: Unless I'm missing something, Blitz only handles page caching, not assets?
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-16T18:42:21.987Z
Answers.Text: That depends on your cloudfront configuration -- If you're serving assets via the same domain/server blitz can reset the entire cloudfront cache.
Answers.UserDisplayName: Philip Zaengle
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-16T15:16:13.697Z
Answers.LastActivityDate: 2021-09-16T15:16:13.697Z
Answers.UserDisplayName: Philip Zaengle
Body: <p>I'm trying to get static assets set up to be served by CloudFront. I know how to get the S3 bucket working, and have CloudFront serving from that bucket, but what I can't wrap my head around is how to handle the invalidation. In non-Craft instances I know about hashing to trigger the invalidation, but not sure how to do that in Craft. </p>
  
  <p>Specifically, if an editor uploads a photo named "photo.jpg", and then publishes, and decides to make a change and uploads the revised photo with the same name, how does CloudFront know that it has changed since the editors don't know about content hashing? </p>
  
  <p>Hopefully this makes sense. While not at all new to Craft, I'm very new to running it with performance in mind and even newer to using a CDN. Any help is greatly appreciated!</p>
  
Tags: <cache>
Title: Using Craft with CloudFront, and handling invalidation
ThreadText: # Using Craft with CloudFront, and handling invalidation
  
  (Asked by: username_0 on 2017-06-09)
  
  I'm trying to get static assets set up to be served by CloudFront. I know how to get the S3 bucket working, and have CloudFront serving from that bucket, but what I can't wrap my head around is how to handle the invalidation. In non-Craft instances I know about hashing to trigger the invalidation, but not sure how to do that in Craft.
  
  Specifically, if an editor uploads a photo named "photo.jpg", and then publishes, and decides to make a change and uploads the revised photo with the same name, how does CloudFront know that it has changed since the editors don't know about content hashing?
  
  Hopefully this makes sense. While not at all new to Craft, I'm very new to running it with performance in mind and even newer to using a CDN. Any help is greatly appreciated!
  
  **Tags:** cache
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-06-09. Score: 2 | Accepted answer
  
  One way would be to manually clear it with [Cloudfront Invalidation](https://superbig.co/plugins/cloudfront-invalidation).
  
  > **Comments:**
  > **username_2**: Is there another option for Craft 3?  
  > **username_1**: I believe its built in to the S3 plugin?  
  
  ---
  
  ### Answer by username_3 on 2021-09-16. Score: 1
  
  Your best option for Craft 3 is to use [Blitz](https://putyourlightson.com/plugins/blitz) and the [Cloudfront Blitz Plugin](https://github.com/putyourlightson/craft-blitz-cloudfront).
  
  This combination will allow your craft instance to automatically expire CloudFront caches as needed, or clear the entire CloudFront cache from the CraftCMS CP.
  
  > **Comments:**
  > **username_4**: Unless I'm missing something, Blitz only handles page caching, not assets?  
  > **username_3**: That depends on your cloudfront configuration -- If you're serving assets via the same domain/server blitz can reset the entire cloudfront cache.  
  
  ---
  
  