W
W
wartur2012-09-13 20:59:54
PHP
wartur, 2012-09-13 20:59:54

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

5 answer(s)
A
avalak, 2012-09-13
@wartur

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.

A
Alexey Huseynov, 2012-09-13
@kibergus

gzip. With the appropriate apache module. Other methods after gzip will not give a special increase.

I
Igor, 2012-09-13
@igoravr

GZIP Compression

M
MrMig, 2012-09-14
@MrMig

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!

M
MrMig, 2012-09-14
@MrMig

Let me clarify: using the boilerplate in a simple case, you just have to directly lay out the frontend, add dynamics , run the build script and copy the resulting folder to the server .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question