Web Hosting Talk







View Full Version : CSS Compression


Ariolander
01-14-2010, 10:11 PM
When you put a site "live" do you compress your CSS code? Is the space saved and performance gained really that significant?

I know my professor always said to maintain 2 copies 1 for local development and 1 for deployment and to strip out all your comments and formatting before you go live. "No reason to make a code stealer's job easier right?" as he would say.

Personally though I sorta take pride in my clean, human readable, and hand written code (Notepad++ FTW!) and the comments I leave for myself. Is this a good habit or maybe a useless display?

dennisthompson
01-14-2010, 11:54 PM
I just leave my CSS as is really.. I leave comments in to remind me of ending segments in the source code and little reminders in the external style sheets if need be. I, like you, take pride in my human readable code :D

http://www.cssdrive.com/index.php/main/csscompressor/ allows you to compress your CSS code. My compression results are ok I guess... Here are my results from my style sheet:

Compression results

Original size: 8580 bytes
Compressed size: 6005 bytes
Savings: 2575 bytes (30%)

Website themes
01-15-2010, 12:26 AM
When you put a site "live" do you compress your CSS code? Is the space saved and performance gained really that significant?

I know my professor always said to maintain 2 copies 1 for local development and 1 for deployment and to strip out all your comments and formatting before you go live. "No reason to make a code stealer's job easier right?" as he would say.

Personally though I sorta take pride in my clean, human readable, and hand written code (Notepad++ FTW!) and the comments I leave for myself. Is this a good habit or maybe a useless display?

For most sites I leave them in. But some CMS like drupal have automatic compression built in so I don't have to worry about it.

dotflyer
01-15-2010, 02:05 AM
same me, I also leave CSS same as original.

AtomicPages-Jackson
01-15-2010, 03:29 PM
The automatic compression with drupal is very handy :)

zoobie
01-17-2010, 09:14 PM
no need to compress because it's cached then called upon repeatedly in the users temp internet folder

lethal0r
01-18-2010, 07:29 AM
much more important for mobile sites I would say, where it can take 10 - 20 seconds for a page to load on your phone. maybe you could shave an entire second off.