Skip to content Skip to sidebar Skip to footer

Unexpected Behavior When Increasing Network Speed And Connecting To A Node.js Server

I have a simple node.js server like: var app = require('express')(); var compression = require('compression'); app.use(compression()); app.get('/', function(request, response) {

Solution 1:

Express.js compression options

I would also not hesitate to change the different compression quality settings, strategies and especially the treshold setting of the express compression module, as described here: https://github.com/expressjs/compression, especiall the:

Compression Treshold Level

Since you are sending only a few bytes of textual data as body, try to set the treshold lower then the default of 1Kb.

The byte threshold for the response body size before compression is considered for the response, defaults to 1kb. This is a number of bytes, any string accepted by the bytes module, or false.

(cited from the express compression module github page)

HTTP Compression is not always faster

Make sure to play around with other HTTP features like HTTP Pipelining or accepted encodings (also on the client side) as switching those on or off may vastly alter the outcome of download time.

IBM conducted a series of excellent HTTP tests which I recommend you read about here: http://www.ibm.com/developerworks/library/wa-httpcomp/

Post a Comment for "Unexpected Behavior When Increasing Network Speed And Connecting To A Node.js Server"