Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

s3 never-ending pending audio requests

Tags:

amazon-s3

I have an mp3 file on s3 (and have experienced with many other mp3 files) that is not playing in chrome (and other browsers as well: FF, safari, etc). The network dialog in chrome shows that there is a pending request that is seemingly never responded to by s3, however if I do a wget to the URL, I get an immediate response.

Additionally, if I serve the exact same file off of a server running nginx, I can access the URL in chrome as well instantaneously. I know that S3 does support byte range requests, so there should be no issue with chrome's byte range queries. Additionally, I've verified that the file is accessible, and that its content type is audio/mpeg.

Here is the file in question: http://s3.amazonaws.com/josh-tmdbucket/23/talks/ffcc525a0761cd9e7023ab51c81edb781077377d.mp3

Here is a screenshot of the network requests in chrome for that URL:enter image description here

like image 437
Josh Nankin Avatar asked Feb 11 '13 18:02

Josh Nankin


1 Answers

I solved this by creating a CloudFront distribution. You need to create a distribution for your bucket. For example if you have a bucket named example-bucket, go to CloudFront and click on create distribution. Your bucket will appear in Origin Domain Name as example-bucket.s3.amazonaws.com

Now you can use example-bucket.s3.amazonaws.com url to load content. This worked for me but I am not sure if it will work for others.

like image 86
Bilal Avatar answered Nov 11 '22 02:11

Bilal