3 ms·
Not a direct answer, but also interesting to consider: As everything will end up in a packet when sent through the network stack, you might want to choose your
by jand 8y ago
Not a direct answer, but also interesting to consider:
As everything will end up in a packet when sent through the network stack, you might want to choose your minimum input size in such way, that you generate gzip-compressed output big enough. Why big enought? Nagle's algorithm [1]
So yet another reason to think about 'what to gzip'.
[1] https://en.wikipedia.org/wiki/Nagle%27s_algorithm https://en.wikipedia.org/wiki/Nagle%27s_algorithm
- tialaramex 8y agoApplications that always know exactly what they want to send disable this algorithm, as that article explains, by setting TCP_NODELAY or its moral equvialents in their framework. A web server will almost invariably set TCP_NODELAY. More sophisticated algorithms can either decide exactly which packets to send, or use TCP_CORK to shove part of a packet into a buffer before they add the rest of the stuff, e.g. preparing HTTP headers and then adding the static document that goes after them.
- tedunangst 8y agoIf you read the page you linked, it says the algorithm applies to data of any size.