user5738822
user5738822

Reputation:

compression gzip not working (expressjs - compression library)

I use from compression library and still not working.. this is my config :

const app = express();

app.use(compression());

app.use("/public", express.static(path.join(path.resolve(__dirname, '../../public'))));

enter image description here

Upvotes: 2

Views: 2408

Answers (1)

user5738822
user5738822

Reputation:

according to this link By default, this module does not compress responses that contain already compressed assets, like JPEG images. You can use the filter option to override this behavior if you like.

app.use(compression({
  filter: function () { return true; }
}));

Upvotes: 3

Related Questions