Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 Audio Player makes multiple GET requests when loading. Why?
    primarykey
    data
    text
    <p>I have been working on a jquery plugin that uses a HTML5 audio player () to play back mp3's. I noticed that in various browsers multiple GET requests were made for the same MP3 file when the audio player was loaded.</p> <p>I created a simple standalone HTML file to test this out.</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;audio controls src="http://localhost:5000/files/one.mp3" type="audio/mp3"&gt;&lt;/audio&gt; &lt;body&gt; &lt;html&gt; </code></pre> <p>When opening the page in OS X Safari 5.0.1, I saw the following logs from my web server (3 GET requests):</p> <pre><code>&gt;&gt; Thin web server (v1.2.7 codename No Hup) &gt;&gt; Maximum connections set to 1024 &gt;&gt; Listening on 0.0.0.0:5000, CTRL+C to stop 127.0.0.1 - - [17/Aug/2010 11:09:32] "GET /one.mp3 HTTP/1.1" 200 4030432 0.0022 127.0.0.1 - - [17/Aug/2010 11:09:32] "GET /one.mp3 HTTP/1.1" 200 4030432 0.0012 127.0.0.1 - - [17/Aug/2010 11:09:32] "GET /one.mp3 HTTP/1.1" 200 4030432 0.0010 </code></pre> <p><em>Note, the requests are for "GET /one.mp3" and not "GET /files/one.mp3" because my Thin web server is running off a prefix of /files.</em></p> <p>When opening the same HTML file in OS X Chrome, I saw 2 GET requests for /one.mp3.</p> <p>When opening the same HTML file in OS X Opera, I saw 1 GET request for /one.mp3.</p> <p>What is the reason for the multiple GET requests for a single files? The bandwidth on my server is limited and I throttle connections at 75KB/s (thats HTTP connection, not user). My worry is if Safari is making 3 HTTP connections to download (stream) a single mp3 file, it will reduce the number of concurrent users my server can handle.</p> <p>Is this something I should be worried about in terms of performance/bandwidth? Also, I am curious as to why certain browsers make multiple requests for the same file, while other do not.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload