Skip to content

Serve static pages efficiently. Fix #53 #118

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

Merged

Conversation

HHHartmann
Copy link
Contributor

@HHHartmann HHHartmann commented Oct 5, 2017

Allows to load up to 5 static URLs at the same time.
The limit of 5 seems to be imposed by the system.

This should at least partially fix #53

@HHHartmann HHHartmann changed the title Serve static pages efficiently Serve static pages efficiently fixes #53 Oct 8, 2017
@HHHartmann HHHartmann changed the title Serve static pages efficiently fixes #53 Serve static pages efficiently. Fix #53 Oct 8, 2017
@HHHartmann
Copy link
Contributor Author

anybody willing to review this?

@marcoskirsch
Copy link
Owner

I will soon, my bad.

@Fractal147
Copy link
Contributor

Err, while this achieves the goal, can't you achieve most changes from within httpserver-static.lua? You can access the socket within bufferedConnection, and yield there - no buffer used, no problem.

The chunks are 1024 big, but have no buffer to worry about since it's never filled
There are further things to do, like setting req=nil in httpserver.lua for static, but this seems pretty efficient to me - and works with 5 cars on chrome desktop.
See PR #123

@HHHartmann
Copy link
Contributor Author

The main advantage in this PR is to get rid of the coroutine overhead which seems to be quite large.
The rest might be done differently. But what seems important to me is that the memory footprint between sending chunks is minimal (only filename and position) which helps executing several requests at the same time.

@marcoskirsch marcoskirsch merged commit ca4fb20 into marcoskirsch:master Nov 14, 2019
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.

Can't handle page with embedded images
3 participants