You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use sirv to deliver a moderately large JS file (~400kb) in dev environment, and noticed it had trouble handling it fast, even being static.
By opening it directly in browser, it took some seconds to load all its content. By fetching it via AJAX (my usage for this project) it also took the same time.
Hey, this will be improved in the next major version of sirv – getting 1.0 out the door is near the top of my TODO list. Immediately after, 2.0 will be released with HTTP/2 support. This is when the problem will be fixed.
Unfortunately, in HTTP/1, the only way Node.js can send a file is by reading it & piping the contents to the response. Currently, sirv does this the most efficient way possible thru fs.createReadStream. It can only be improved further if sirv held all your files' contents in memory, but this can quickly cause other problems 😕
Completely forgot about Range/partial requests! 🤦♂️ All browsers will do this by default for large files (eg, videos, PDFs) so it will seemingly speed up these large assets by sending them down in pieces.
I tried to use sirv to deliver a moderately large JS file (~400kb) in dev environment, and noticed it had trouble handling it fast, even being static.
By opening it directly in browser, it took some seconds to load all its content. By fetching it via AJAX (my usage for this project) it also took the same time.
Edit:
Here is a sample file, but I believe it may happen with any other format.
The text was updated successfully, but these errors were encountered: