Optimizing asset delivery with gzip compression in Express

Reducing the size of assets can mean a few different things in a web application. Commonly, minification tools remove whitespace and generally transform human-readable code into very efficient, but virtually unreadable minified code. This operation usually occurs in concert with file concatenation using utitilies such as uglify.js. The other way to reduce asset file size is through the use of asset compression, either by optimizing assets directly such as jpeg quality, or through the use of compression algorithms that can be sent over the network to be decoded by the browser. Gzip is a common solution that is supported by virtually every modern browser and provides huge file size savings for resources with lossless compression that can be up to 90% smaller than the uncompressed file. It works by applying a compression algorithm ahead of time to a resource's content, and then relying on a web server to serve it with a Content-Encoding header set that declares the resources as encoded to the browser. Once the browser receives the content, it inflates the content natively and loads it as if it received the original uncompressed resource.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.58.62