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

Feature Request: Serving Files directly from a zip file... #1021

Open
frink opened this issue Dec 1, 2019 · 3 comments
Open

Feature Request: Serving Files directly from a zip file... #1021

frink opened this issue Dec 1, 2019 · 3 comments

Comments

@frink
Copy link

frink commented Dec 1, 2019

I've seen a few servers start to serve a mount from a prezipped file system. This means only non-compressed connections get the performance hit on decompression and the website is much easier to deploy as a single zip. (possibly even appended to the app binary for even easier transport...) This could be very useful for IoT use cases...

Here's how LWS handles it...

@gdamore
Copy link
Contributor

gdamore commented Dec 1, 2019

It should be pretty easy to build this. I've not gone too far out of my way to make NNG an ideal web server -- its not intended to replace NGINX or something like that. It offers the ability most to supplement it's real purpose, which is supporting both the nanomsg protocols and embedded REST style servers (where there is dynamic content or work done rather than just serving up just a bunch of static content.) The idea is that you might want to serve up a JavaScript web page or some supporting content to go with that API.

Today there is no compression algorithm in NNG at all, so this would also mean expanding its set of dependencies.

@frink
Copy link
Author

frink commented Dec 1, 2019

I didn't realize there is no compression. That is probably still something you want. Compression on binary streams can be very helpful...

As far as replacing Nginx I think that serving static files with some sort of zero copy sendfile() style response system will suffice for must use cases to replace NGinx. You already use an evented design pattern so it should be comparable. Adding compression would make it a full drop-in for most every cases.

@gdamore
Copy link
Contributor

gdamore commented Jan 21, 2020

I'm feeling like this should be some sort of middleware drop-in. Maybe not part of NNG proper, but some other layer.

Actually I think I've seen a middleware package developed for NNG already by another party.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants