title: Why is my heroku app loading resources too long even after using gzip compression?
body: <p>I have a MEAN stack app hosted in Heroku. In my Express server, I use gzip (via compression middleware).</p>
  <pre><code>const express = require('express');
  const path = require('path');
  const bodyParser = require('body-parser');
  const cors = require('cors');
  const passport = require('passport');
  const adminpassport = require('passport');
  const mongoose = require('mongoose');
  const config = require('./config/database');
  // Connect to DB
  
  mongoose.connect(config.database);
  mongoose.connection.on('connected',()=&gt;{
      console.log('Connected to database '+config.database);
  });
  
  mongoose.connection.on('error',(err)=&gt;{
      console.log('DB Error '+err);
  });
  
  const compression = require('compression');
  const app = express();
  // Static Folder
  app.use(express.static(path.join(__dirname, 'public')));
  app.use(compression());
  // Body Parser Middleware
  app.use(bodyParser.json());
  
  ...
  
  app.use(function(req, res) {
      res.sendFile(path.join(__dirname, '/public', 'index.html'));
  });
  
  // Index Route
  app.get('/', (req, res)=&gt;{
      res.send('Invalid enpoint');
      
  });
  
  
  
  app.listen(port, ()=&gt;{
      console.log(&quot;Server started on port &quot;+port);
  });
  </code></pre>
  <p>The problem is that the Angular main.js file (that is orginally 3.2mb, compressed to 575kb) is still seemingly being download as if it's still the uncompressed size. Here's an image of the load times:</p>
  <p><a href="https://i.stack.imgur.com/e8ZUG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e8ZUG.png" alt="enter image description here" /></a></p>
  <p>I know my internet connection is fine (around 20mbps). Is there anything I'm missing? Is there something wrong in my implementation of gzip? Or even my Heroku dyno? This app is currently on the hobby dyno. I did change it to the professional one but didnt notice any difference.</p>