danielbayerlein / honeycomb

🐝 Honeycomb is a common basis for @nodejs microservices
MIT License
10 stars 0 forks source link

[honeycomb-asset|generator-honeycomb] Compression #79

Open chrishelgert opened 7 years ago

chrishelgert commented 7 years ago

we should deliver the assets (asset-service, generator-honeycomb) with gzip when possible.

https://github.com/webpack/compression-webpack-plugin

new CompressionPlugin({
  asset: "[path].gz[query]",
  algorithm: "gzip",
  test: /\.js$|\.css$|\.html$/,
  threshold: 10240,
  minRatio: 0.8
});

found a example only for express

app.get('*.js', (req, res) => {
  req.url = req.url + '.gz';
  req.set('Content-Encoding', 'gzip');
  next();
});