-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
gzip support #56
Comments
+1 |
+1 would like this too |
+1 This sure would be sweet! |
+1 |
4 similar comments
👍 |
+1 |
👍 |
👍 |
No news on this ? |
👍 |
I got this working locally (as an always-on feature, not configurable) by modifying http-server.js: before.push(ecstatic({
gzip: true, // HACK: I ADDED THIS LINE!
root: this.root,
cache: this.cache,
showDir: this.showDir,
autoIndex: this.autoIndex,
defaultExt: this.ext,
handleError: typeof options.proxy !== 'string'
})); ecstatic will check if the accept-encoding header allows compression, and if present will look for a file that matches the requested file name with '.gz' at the end. For example: |
+10 |
It't really useful. |
+1! |
Please use the reaction feature to express you'd like to have this feature. |
+1 |
doing an npm install of http-server doesn't seem to pull in the gzip property event after an npm cache clean. Is this feature available in the npm package yet? |
For what I understand the current --gzip option requires you to produce |
@golopot right now, I'd say that on-the-fly compression is "out of scope" for a static web server--which should really just transmit content with minimal involvement. If you'd still like to discuss it, though, please file a separate issue. Thanks! |
To be clear, on-the-fly compression was exactly what I wanted when i originally opened this issue |
Good to know @WickyNilliams. At this point, I don't plan on going beyond what's "underneath" in the form of There are few things we're adding here, but mostly I'm wanting to continue to build up from the node-ecstatic foundation. Any sort of server-side content processing would be out-of-scope in that case. |
@BigBlueHat i wasn't necessarily looking for on-the-fly compression. As noted in my previous comment |
@smarts it's been an option since 0.10.0 was released https://github.com/indexzero/http-server/releases/tag/0.10.0 😄 If you need something more, perhaps open a new issue so we can discuss that there rather than on this closed issue. |
Doh! I now see the pull request that references this issue. Thanks for being patient w/ me @BigBlueHat 😅 |
+100 |
Seriously, don't understand how hard on-the-fly compression can be, in just a few lines: var zlib = require('zlib'); pathName = url.parse(request.url).pathname; var readStream = fs.createReadStream(fp); |
@Nashorn you're more than welcome to turn your suggestion into a pull request! |
It's not clear from looking at http-server.js, where I would integrate the above solution which does dynamic gzip compression on responses. I found this area, but not even sure where/how to plug in.
|
Would it be possible to have an option for gzip/deflate compression?
The text was updated successfully, but these errors were encountered: