DEV Community

Cover image for Gzip Compression for Beginners
Ganesh Raja
Ganesh Raja

Posted on

2 3

Gzip Compression for Beginners

Gzip is a compression method that makes files smaller for faster network transfers.

Say, you have an HTML page with 1 MB size, Instead of sending this directly to the client, you can compress it by using Gzip compression. This will reduce the size of the file which will result in faster transmission of the file.
Once the client browser receives the file, it can uncompress and render the file.

This is applicable for all the HTML, CSS, JS and JPEG files. Gzip reduces the file zip by fifty per cent generally. most of the modern browsers support Gzip Compression. if a browser supports gzip it includes, "Accept-Encoding: gzip,deflate" in its header while making a request. if the header doesn't have this value you can send plan HTML page the old way.

Gzip can be don't dynamically or statically to avoid the server load. Gzip Can't compress PNG, Zip or any other already compressed formats.


Read about my python scripts challenge here

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more