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
Shows an example but uses readFile which itself is bad because it loads the entire file in memory.
The page doesn't show any other direction to the reader if they want to avoid using readFile or intend to serve partial content especially for videos.
For comparison, express.static has partial content support, and doesn't load the entire file in memory as well. (vercel's serve-handler also does this but it has been pretty stale)
I'm not sure what you intend with the page but here are some solutions in my head
mark the page as "not production use"
explain the performance pitfalls of the implementation
direct readers to other middlewares for partial or memory friendly implementations of static serving
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
https://h3.unjs.io/examples/serve-static-assets
Shows an example but uses
readFile
which itself is bad because it loads the entire file in memory.The page doesn't show any other direction to the reader if they want to avoid using
readFile
or intend to serve partial content especially for videos.For comparison,
express.static
has partial content support, and doesn't load the entire file in memory as well. (vercel's serve-handler also does this but it has been pretty stale)I'm not sure what you intend with the page but here are some solutions in my head
Beta Was this translation helpful? Give feedback.
All reactions