Comments (6)
No, as Z_PARTIAL_FLUSH
is dangerous and is infact deprecated in zlib. It only exists because some protocols need it (SSH). It also really hurts your compression ratio.
from compression.
Though if you can point me to research done on this and what the exact effects are on the underlying byte stream, compression, etc., please let me know and we can reconsider.
from compression.
I don't think this flush method is interoperable with all browsers, either (especially older browsers).
from compression.
Looks like it was undeprecated back in 2009 http://www.zlib.net/ChangeLog.txt
I'm using it on https://wiki-offline.jakearchibald.com/wiki/Hulk_Hogan?use-url-flags&avoid-wikipedia=1&prevent-sw=1, and not seeing any change in the gzipped size without it. However, I am no zlib expert.
Kinda worried now, what are the dangers you mentioned?
from compression.
So the main thing I saw last time I looked into this was various clients not accepting this kind of flush (the actual streams bytes are different) as well as it doesn't actually flush when you want it to. I see you are trying to flush right after the head and before the body. Using this instead of calling res.flush means it may not flush at the right spot and you won't get exactly what you're looking to get out of this.
If your concern is only modern web browsers and don't care about non web browser clients, then if this flush seems to be working for you, you can certainly use it :)
from compression.
I can't find anything on the browser support, but yeah I'm only targeting modern browsers here.
Yeah, the intention is to flush for the header, but additional flushing is welcome. res.flush
was working for me, but required a lot of hackery to make it work with dust (a streaming templating language), although I realise that's not this projects problem.
Thanks for the help!
from compression.
Related Issues (20)
- Setting Vary header although caching is disabled HOT 1
- "drain" event listener leak when using res.once("drain"); can't use res.removeListener("drain") HOT 3
- compresssion doesn't work ,the vue.txt is 2m HOT 2
- Content-Type: application/json; charset=utf-8 No effect HOT 2
- Question: Why this middleware HOT 2
- Corrupted compressed .js-files for Mac OS / Safari -clients HOT 11
- Is compression working when node server is running on a container? HOT 2
- middleware fails when the request has more than 1 values for accept-encoding header HOT 2
- Is compression result cached? HOT 1
- change Transfer-encoding HOT 1
- Why does the data size increase after compression HOT 1
- Force size to be a minimum... HOT 2
- Chunked encoding is broken after using this middleware HOT 1
- Using a current debug version HOT 1
- Deflate backwards HOT 7
- Compression instrumentation (before/after compression hooks) HOT 2
- Angular Not Compressing? HOT 2
- compression not working json payload HOT 6
- Crash when compressing characters like ū HOT 1
- Express returns a non-compliant HTTP/206 response when gzip is enabled HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compression.