AWS CloudFront: Content not immediately available

1.1k views Asked by At

I'm trying to use CloudFront as the CDN in front of my S3. I have a bucket for the media that users can upload, one type being an image and the other a video. When the users upload an video, AWS's elastic transcoder transcodes the video into an HLS streaming playlist, an MP4, and a thumbnail. My problem is that when I am uploading my media, it is immediately transcoded and placed in the bucket as it should, but my cloudfront url returns Access Denied. I tried using a different cloudfront URL to the same path to test, and they never consistently worked. Sometimes, one would have the content and the other wouldn't. Also, changing to HTTP from HTTPS seems to work sometimes. Is CloudFront supposed to not work immediately, and if not, what could be causing it?

1

There are 1 answers

0
avjaarsveld On

As per my comment made an hour ago, I had the same issue for images uploaded to/hosted on AWS S3. Some images could not be accessed via Cloudfront for a few seconds after upload, but could be accessed/loaded directly on S3.

The eventual solution was to create a duplicate replacement Cloudfront distribution (with the same settings) to replace the existing one.