Search code examples
amazon-s3amazon-web-servicesamazon-cloudfront

AWS S3 + Cloudfront streaming, updating a file


I have a website, where I stream a video via Javascript.

The video is stored on Amazon S3, and then streamed through Cloudfront.
Recently I updated the file, which is an mp4 (deleted old file, uploaded new file with the same name).

I could create a new file but I really wanted to keep the same file name, I knew that cloudfront has caching but I read its only 24 hours, so I don't mind waiting 24 hours for my video to be updated.

But the problem its more than 48 hours later, and my video is still the same old file. What can I do to get my video updated ?

When I go in my files properties, it says "Expiry Date: None", I haven't set anything myself.

Thank you

PS: Cache invalidation does not work for streaming in Cloudfront.


Solution

  • Cloudfront also features an invalidation request. With this request, you can manually expire elements in your distribution.

    You can also do this via the AWS console. Click on your Cloudfront distribution to find a tab "Invalidation". There you can enter your desired file paths to invalidate.