Created
May 2, 2020 08:55
-
-
Save ashinzekene/d63ee7087c0695c7e5cfe93c9a0892df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple nodeJS express middleware for serving gzip alternatives | |
// Source: https://medium.com/@rajaraodv/two-quick-ways-to-reduce-react-apps-size-in-production-82226605771a | |
app.get('*.js', function (req, res, next) { | |
req.url = req.url + '.gz'; | |
res.set('Content-Encoding', 'gzip'); | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment