lmao someone found out that reddit downloads every video at every quality in the background while you scroll the site which really eats up bandwidth
Y2Mate.is - How Reddit WASTES your bandwidth.-99cVnYY9Iqs-720p-1655434694143.mp4
Video guy is mostly wrong. Reddit uses
Dynamic Adaptive Streaming over HTTP (DASH) and only downloads a little bit of the video as you scroll past it. The "multiple resolutions" are the different qualities that DASH is fetching as it measures how much bandwidth you have, and they aren't the entire video. They immediately stop requesting more segments once the video is paused or scrolled out of view, but requests that are already out get responded to (which is why the downloads continue for a little bit after the super speed scroll).
The only reason reddit is using that much bandwidth is because he stopped on a video (which caused more of it to be buffered) and because he is scrolling incredibly fast, which loads the first little bit of a lot of different videos. To be fair to him, if you spent enough time browsing Reddit you would use the same bandwidth as the test, but I'd assume that someone doing that would actually want to watch the videos, even if just to see if they are interested in them.
Autoplaying video is the cause of the bandwidth usage and all implementations of it suffer the same issue once playback starts, not just Reddit's. The Twitter test isn't fair because the Reddit feed had a lot more videos (note the large number of
jpegs in the Twitter request log), he scrolled for more time on Reddit, and Twitter's video quality is always garbage.
For a good implementation, YouTube is a better example than Twitter. YouTube has "autoplay", but it isn't quite the same feature. On desktop, autoplay doesn't happen unless you hover over the video for a little while, and a short GIF with only a few frames is downloaded instead of the video. On mobile, they play the whole video, similar to Reddit, but just like on YouTube desktop, you have to pause for a little while (longer than on desktop) before the video starts playing. Adding a longer delay before playing the video and fetching at most a video the size of the player are really the only two ways that Reddit could improve.
Here's a reddit video request (edited for privacy and brevity):
See the
Range header? It describes which group of bytes from the video file that the server should return.
The server respects it, and returned 80 bytes (see the
Content-Length response header (863 - 784 = 79, but the range is inclusive which gives back the extra byte)). The
Content-Range header also matches the requested
range.
Also, status code 206 is
Partial Content, which further hints as to what Reddit is doing:
The HTTP
206 Partial Content success status response code indicates that the request has succeeded and the body contains the requested ranges of data, as described in the
Range header of the request.
If there is only one range, the
Content-Type of the whole response is set to the type of the document, and a
Content-Range is provided.
The reason why the whole video plays when he double clicks on it is because he is downloading the entire video at that resolution because Chrome isn't sending the
range header when downloading the
https://v.redd.it/KEY/DASH_RES.mp4 file through Dev Tools.
He's also wrong about what
m4s is. It is not a better compressed video than
mp4; it's the same thing!
m4sis a segment of an
mp4, but the extension doesn't matter as its not a file saved to disk, and Reddit's
mp4s are actually functionally
m4ses due to the
range header.
One guy on Reddit noticed the same thing as me (
comment 1,
comment 2,
comment 3,
comment 4), but everyone else in
that thread believes the video. Arlios (the video creator, aka /u/TheChowderOfClams), replied to two of those comments with the same comment where he doubled down with his wrong explanation:
The only thing true in Arlios' comment is that Reddit still loads the first segment of a video when autoplay is disabled and you scroll past it, which they probably shouldn't do until you click play. For me,
https://new.reddit.com/r/all with five videos on the initial page load and autoplay disabled transfers 12.3 MB with a clean cache of which 5.3 MB are the videos, or ~1 MB per video. If you have less bandwidth, the amount per video would be less because DASH would not pick the highest possible resolution (and when I limited my bandwidth to "Slow 3G" using Dev Tools, Reddit only requested 480p at most). If you have visited Reddit before and have a hot cache, the non-video part drops to ~1.3 MB.
Sorry for the effort post, but it really annoys me when someone makes a smug video without knowing the first thing about what they are talking about. I have my own opinions on the quality of Reddit's engineers (like the fact that Facebook had to optimize Reddit's mobile website for them because it was making React look bad), but they are smarter than the creator of the video.