Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Gzip compression #916
Comments
|
I would assume (but don't know) web servers cache their gzipped versions of static pages. Thus, gzipping on git push feels like almost useless to me. |
|
@louisjc I think it's possible to write a jekyll plugin that will automatically make a gzip copy of all .css and .js files when the site is building, in case you're interested. It's worth to note that static content is only loaded once (agressive caching). So compressing static files probably would only make a small difference. @schildbach I always read that gzip slightly increases the CPU load for most websites. I think that would deserve more testing before enabling gzip compression on the fly, especially given that the website has to deal with DDoS attacks once in a while and the performance improvement isn't high. |
I would think that if the files were pre-gziped, it would require the same CPU to serve them as serving any other file. (For example, IIRC, png files use zlib compression.) I also think there might be plugins out there already for Jekyll that gzip all files after building the site. For example, I just skimmed this blog post. I don't know what all the tradeoffs would be. |
Sure! Using Edit: Browser compatibility seems fine, with only IE6 not supporting compression (and it seems possible deal with that issue with a simple |
|
@saivann oh, sorry for the confusion. Changing the build script would indeed be ideal, as it would only affect the content on the build server, and would leave the content in our individual development environments alone so we could continue to do things like diffing the output from different builds. |
|
@saivann oh, gzipping via the build script would break the manual-check-diff-sha256sums Makefile command, but I wouldn't worry about that for now. I can probably fix that the next time I need it. |
louisjc commentedJun 24, 2015
I think the server should serve gzip compressed static files. I did a quick test on the css file and the result save 36,8Ko on this single file.
I think the best way to do this is:
Make a script that create .gz for every js, css and svg on the server on push (To avoid spaming this git with gz files) and then Add "gzip_static on" in the nginx configuration for those files only (To avoid on the fly compress of others files)
The "gzip on" is simpler to implement but it compress on the fly each file so I think this is a waste of cpu resources (and response time) because those files aren't changing often.