Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps.ts for changes in send.ts #127

Closed
wants to merge 1 commit into from
Closed

Update deps.ts for changes in send.ts #127

wants to merge 1 commit into from

Conversation

hviana
Copy link
Contributor

@hviana hviana commented May 27, 2020

The function created to send static files (oak / send.ts) is cool, but it has a big problem: to send a file, the file is loaded completely into memory. This is a problem because, for example, if there are thousands of simultaneous requests, and there is a 1MB static file, the server will have GB's of memory occupied and will probably die. This is also a problem if there is a large file to send, even with few requests. The modifications I made send the files via Buffer, which solves the problem and makes the function scalable.

The function created to send static files (oak / send.ts) is cool, but it has a big problem: to send a file, the file is loaded completely into memory. This is a problem because, for example, if there are thousands of simultaneous requests, and there is a 1MB static file, the server will have GB's of memory occupied and will probably die. This is also a problem if there is a large file to send, even with few requests. The modifications I made send the files via Buffer, which solves the problem and makes the function scalable.
@kitsonk
Copy link
Collaborator

kitsonk commented May 27, 2020

Please combine with #126.

@hviana hviana closed this May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants