0

I might be missing something, but I can't make my node server compress its static resources when responding.

this is how my relevant parts in the server look like:

var express = require('express');
var app = express();

app.set('port', process.env.PORT || 3000);
app.set('ip', process.env.IP || "0.0.0.0");
// middlewares
app.use(express.compress({threshold : 0}));

a request for any static resource (js file for example) responses with un-compressed content and these are its headers:

HTTP/1.1 200 OK
x-powered-by: Express
accept-ranges: bytes
etag: "7063-1409483577000"
date: Mon, 01 Sep 2014 07:26:33 GMT
cache-control: public, max-age=0
last-modified: Sun, 31 Aug 2014 11:12:57 GMT
content-type: application/javascript
content-length: 7063
vary: Accept-Encoding
Tom Grant
  • 2,027
  • 18
  • 22
konfortes
  • 99
  • 1
  • 2
  • 8

0 Answers0