feat: don't read full file if range header is present#1002
Conversation
alexander-akait
left a comment
There was a problem hiding this comment.
What we need to finish?
Codecov Report
@@ Coverage Diff @@
## master #1002 +/- ##
=======================================
Coverage 97.90% 97.91%
=======================================
Files 10 10
Lines 287 288 +1
Branches 100 102 +2
=======================================
+ Hits 281 282 +1
Misses 6 6
Continue to review full report at Codecov.
|
|
@alexander-akait Sorry I forgot to remove the WIP notice. The PR is ready to be reviewed with no further changes intended on my side. |
Can you provide link on the original code? |
|
|
Is there anything left I can do to help this PR progress? |
|
@JonnyBurger Sorry for delay, still in my TODO, hope I will merge it on this week |
|
No stress! |
This PR contains a:
Motivation / Use-Case
I am reading in a 2GB file for Remotion. This is a framework for making videos in React, and the end product is not shipped to a website, but written to an MP4 file. Therefore it's not a problem that we import these large files in Webpack.
However, when the browser is loading a video, and we seek forward, then a range header is sent to Webpack Dev Server. Unfortunately it is slow, because WDS is still loading the full file. I adapted the logic from
serve-handlerinstead so instead of reading the full 2GB file synchronously, it uses a Read Stream.Breaking Changes
No breaking changes.