I'm having some issues with MP4 byte range caching and Apple browsers. I have a cache node that grabs content from a backend node, and caches it, and then serves it to users. This is done using nginx proxy_pass along with nginx caching.
I found that many browsers will first request the whole video (byte range 0-infinite) first, and then request chunks afterwards. This was an issue because it would cause the cache node to download the whole video from the backend at once. To fix this, we had the cache node split the requests into 10M chunks, no matter how big the byte range requested was. This worked for almost all browsers, except Safari. For both Desktop as well as iOS safari, Safari throws a media corrupt error almost instantaneously. The error is throw as soon as request is sent with the byte range set as the full file. If we don't rewrite the request, it works fine on Safari, but causes for the cache nodes port to be saturated almost all of the time, because when someone starts streaming a file, the whole file is downloaded to the cache node, saturating the port. Any suggestions on how I can fix this would be appreciated.