title: How to set the appropriate http headers for gzip
body: <p>I'm using Unity's WebGL and I'm getting this message on the console <strong>"You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression."</strong> So according to Unity's documentation, I need to add the correct response Headers <a href="https://docs.unity3d.com/Manual/webgl-deploying.html" rel="nofollow noreferrer">https://docs.unity3d.com/Manual/webgl-deploying.html</a>.</p>
  
  <p>I found the "express-static-gzip" module, and I tried to do just that, but the warning is still there. Below is the server.</p>
  
  <p><a href="https://i.stack.imgur.com/iP0rQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iP0rQ.png" alt="enter image description here"></a></p>
  
  <pre><code>const express = require('express');
  const ip = require("ip");
  const expressStaticGzip = require('express-static-gzip');
  const http = require('http');
  
  
  const app = express();
  const server = http.Server(app);
  
  app.use('/public/Builds/Build/', expressStaticGzip('public/Builds/Build/', {
      customCompressions: [{
          encodingName: "gzip",
          fileExtension: "unityweb"
      }]
  }));
  
  
  // app.use(compression());
  app.use(express.static('public'));
  
  server.listen(3000, function(){
      console.log( ":: http://" + ip.address() + "/ ::" );
  });
  </code></pre>
  
  <p>Any ideas?
  Nick</p>