Answer the question
In order to leave comments, you need to log in
How can you compress html code?
Hello gentlemen.
I would like to hear the opinions of others about what they would use to compress html code on the fly.
My development stack:
- apache 2.2
- php 5.3
- yii 1.1
For Apache, I found a module to compress
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
For Yii, I found a module to remove extra spaces
http://www.yiiframework.com/extension/yii-html-compactor/
Also, my template engine cuts out everything that is not needed at the compilation stage.
Question.
And what do you use? Maybe there is some Apache module that can cut spaces. Maybe you can recommend something else.
Thank you for your attention.
Answer the question
In order to leave comments, you need to log in
Less/Coffee - compilation + minification.
png, jpg - pngcrush, jpegtran
CSS, JS, HTML - the server compresses gzip.
+ Google HTML/CSS Style Guide
Actually, the recommendations of Google and gzip are more than sufficient.
gzip. With the appropriate apache module. Other methods after gzip will not give a special increase.
I advise you to pay attention to the html5 boilerplate and the bundler based on it initializr . There are several articles on the hub.
Boilerplate is a set of best practices for developing static cross-browser sites (html5 + css + javascript). In addition, it includes settings for Apache and a build script, which just deals with the minification of resources (css, js, html, png).
Spend an hour exploring - you won't regret it!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question