Awesome! I’m not really near a computer today, are you able to check if the page in the OP loads the video and audio file?
I tried it and in both cases, I only get audio. I see that video.ogv
is requested, but only audio is being played.
Hey, I just checked this by editing my /etc/hosts
file and going to https://f2j4a-eiaaa-aaaam-ab7nq-cai.raw.icp0.io/ and both the video and audio file are working just fine!
I would be curious to know why the video isn’t loading for you…
So the ranges being returned a larger than my Express Azle server allows…are the boundary nodes doing some kind of caching of the range requests? Would you be able to explain how this cache works so that I can understand scalability implications. Also, does my server even need to implement range requests if the boundary nodes are caching?
I assume this might make the boundary nodes able to respond more quickly to a request…I’m just not sure what’s really going on under-the-hood here, as it seems there is some machinery in-between the client and my Express server.
Hey @lastmjs
Indeed, the boundary nodes cache slices of the file you are requesting: No matter what range you request, the boundary nodes request slices of 1MB in size, cache that and serve your requests from cache.
The relevant config is here and if you are interested you can read up on the following two articles that explain the intricacies of caching range requests: nginx on caching (in particular “Byte Range Caching”) and a general article on why caching ranges is difficult.
Is it still early next week? Any chance of this getting deployed soon?
Hey @lastmjs
We deployed another canary today and if all looks good tomorrow, we will roll it out to all boundary nodes.
Hey @lastmjs
The version was rolled out earlier today. Range requests should now be supported on all boundary nodes. Let me know if that is not the case for you
Been testing all morning, preparing a demo. Thanks!
It’s working beautifully, here’s the demo (original link from OP): https://f2j4a-eiaaa-aaaam-ab7nq-cai.raw.icp0.io/
Thanks for getting this done! I really appreciate it and many seem happy and excited about this.
Can you confirm that this is not working with certification? Or are you doing something fancy with certification to make it work as well?
I think this may be messing with our file serving some how. See ERR_HTTP2_PROTOCOL_ERROR for assets on canister.
Same file works from https://prptl.io/-/nszbk-7iaaa-aaaap-abczq-cai/-/64ba621a76bd639aa6484af4/-/logo.png our own proxy.
Hi @lastmjs, we’ve just started implementing range requests to optimize our video streaming. If possible, could you share your approach to getting range requests to work? Thanks in advance!
We used Azle and Express: azle/tests/end_to_end/http_server/audio_and_video/src/backend at main · demergent-labs/azle · GitHub
Thank you for sharing this @lastmjs. We had already pinpointed the issue and fixed it—it turned out to be a simple oversight in our chunking and merging process while handling dynamic range requests. We’re running some tests soon, and this fix will noticeably boost the user experience in the Tapes feed in our DApp. Credit goes to you—this optimization had been on my mind for a while after you dropped tweets about this, but was delayed due to other features taking priority.