I'm using GitHub pages to host my site. While checking Google PageSpeed Insights, it recommends that I enable gzip compression. Since I have a static site hosted on GitHub, I'm not sure that is possible.

Is it possible to enable gzip compression on GitHub?

2 Answers 2


As covered here, GitHub Pages is served with Nginx and automatically gzip's content.

You can confirm gzip compression for your site by checking the HTTP headers with online tools like this one. Enter the URL to a webpage or resource, and type in gzip under "Accept-Encoding" to indicate that the HTTP client (i.e., the online testing tool in this case) accepts gzip compression, as most browsers do.

You might review the other information and suggestions here to optimize serving as well.


besides Dan's answer, depending on your static-site generators, there can be some plugins that make the compressed .gz-ed version offline while generating the site. By that way, your server can serve those gz-ed pages directly.

For example, Pelican users can use gzip_cache. For Jekyll, there's jekyll-press,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.