1

Recently I noticed that the source code of Google pages became really small. It's literally compressed to less than 20 lines (search result for "stackoverflow").

My assumption is that Google Developers would not do this manually.

How to do this automatically? And if possible something that would work on sharing hosting accounts (both Apache and Win IIS).

Thank you.

EDIT

Just to clarify. I want to figure out how to install some plugin on the server, which will minify code (HTML, CSS, JS) automatically. In other words, I don't want to copy code into some compression algorithms and paste the result...

For PageSpeed (mod_pagespeed) to work, one will need a dedicated hosting or at least VPS to install it. Is there anything one can do for sharing hosting accounts?

3
  • Do you get as many hits as Google to warrant saving this handful of bytes? Commented Feb 3, 2011 at 5:58
  • No, just interested how to do it. Commented Feb 3, 2011 at 6:07
  • Google engineers do a lot of peer code reviews. Maybe that's what they do all day — play code golf with each other's code :) Commented Feb 3, 2011 at 6:14

4 Answers 4

3

There are minifiers and packers for JavaScript already out. Check out Dean Edward's packer.

Be careful when removing whitespace from HTML - namely <pre> elements and elements with white-space: pre. Removing extra whitespace from these element's textnodes can ruin the intended display.

Sign up to request clarification or add additional context in comments.

Comments

2

SmartOptimizer (php library) or PHP Speedy (php script) should satisfy your needs.

Comments

0

Take a look at Google Page Speed to get you started.

Comments

0

Compressing javascript: YUICompressor

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.