I am trying to activate gzip compression on all JSON output on sails.js.
I added this in config/http.js:
order: [
'startRequestTimer',
'cookieParser',
'session',
'myRequestLogger',
'bodyParser',
'handleBodyParserError',
'compress',
'methodOverride',
'poweredBy',
'$custom',
'router',
'www',
'favicon',
'404',
'500'
],
compress: require('compression')(),
I know the compress: require('compression')()
line is called because I try with a wrong value and it crashes.
I restarted sails but the headers do not show gzip compression.
Requested headers show I accept gzip compression:
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Thank you for your help!