You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble getting compression to work properly. I've tried reading a lot of resources and your issue pages but I'm still stuck. Oddly, when I use services like http://www.whatsmyip.org/http-compression-test/ it shows that the service is compressed. But when I use chrome to simple try and go to the service, I dont see any compression happening. When I turn on DEBUG=compression I see the message
compression gzip compression +8m.
So I'd like to believe it is working, but the response in the browser shows no compression. Any advice would be great and appreciated! Thanks!
I have a seemingly simple test server/service
varcompression=require('compression');varexpress=require('express');varapp=express();//turn on compressionapp.use(compression({threshold: 0}));// simple get service to get 10000 random numbersapp.get('/events',function(req,res){console.log(req.headers);varobj=[];for(vari=0;i<10000;i++){obj.push({number: Math.random()});}res.send(obj);});//start the servervarserver=app.listen(80,function(){console.log('Address',server.address());console.log('Listening on port %d',server.address().port);});
The headers in my req are
{via: '1.1 DETHQTMG109','user-agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',host: 'usaievents.cloudapp.net','cache-control': 'max-age=0',accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','accept-language': 'en-US,en;q=0.8',connection: 'Keep-Alive','if-modified-since': 'Tue, 20 Jan 2015 15:21:29 GMT','if-none-match': 'W/"YxqKyY8MDi7MUoNr2htsjg=="','accept-encoding': 'gzip'}
The text was updated successfully, but these errors were encountered:
It's no problem :) I was suspicious because you said that compression test site worked and then the request headers you posted had a Via header, which is typically inserted by a proxy. Once a request goes through a proxy, whether or not you see the response is compressed is dependent on the proxy, rather than what the source server did :)
I'm having trouble getting compression to work properly. I've tried reading a lot of resources and your issue pages but I'm still stuck. Oddly, when I use services like http://www.whatsmyip.org/http-compression-test/ it shows that the service is compressed. But when I use chrome to simple try and go to the service, I dont see any compression happening. When I turn on DEBUG=compression I see the message
So I'd like to believe it is working, but the response in the browser shows no compression. Any advice would be great and appreciated! Thanks!
I have a seemingly simple test server/service
The headers in my req are
The text was updated successfully, but these errors were encountered: