My app loads a video here: https://core.arc.io/guanzo/VideoOfPeopleWalking.mp4
It loads the video from another origin in chunks of 16Kb using the Range
request header. My server has set the response header Access-Control-Max-Age
to 10 minutes to prevent redundant OPTIONS requests.
Visit the link (its an HTML page), open the network tools, and observe that it takes around 1s to fetch a 16Kb chunk.
Now check "Disable cache", and you should see the requests finish a LOT faster, and it looks like there are more concurrent requests. This is the opposite of expected behavior, because each request has to fire and wait for an OPTIONS request.
If the cache is enabled, requests should be faster, no? What's going on here?
Here's a reproduction in GIF form: https://i.gyazo.com/ec5941829031cdd4dc684a3b53ec6c39.mp4
NOTE: The chunks are stored in IndexedDB, so if you refresh the page, you'll need to clear IndexedDB to force all the requests to fire.
EDIT: Filter out any firestore requests, I'm not sure why those are firing but it should be unrelated to my question.
EDIT: A new clue! https://i.gyazo.com/bd887533a42868f748564ccda4451881.png
When "Disable Cache" is checked, Chrome will reuse the same TCP connection as seen in the "Connection ID" column. Ostensibly this should make requests faster.