Forum Moderators: open

Message Too Old, No Replies

Should you crunch your code?

advantages and disadvantages

         

HelenDev

12:49 pm on Mar 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It has been suggested to me that we ought to crunch all our website code using a 3rd party tool.

I believe this means to remove all white space and comments from the outputted HTML, as well as 'optimisation' of css and js amongst other things.

Would everyone here agree that this is a Good Thing to do, or does it have any downsides?

Call me a cynic, but I don't know if I'm entirely comfortable with having my code 'optimised' by a third party! Should I simply be 'optimising' it myself?

Quadrille

1:55 pm on Mar 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I doubt simply 'crunching' will make much difference to SEs - and it will make editing much more difficult!

I totally agree with clean, unbloated code ... but that's a rather different issue!

encyclo

2:04 pm on Mar 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The effect that such tools can have is minimal compared to on-the-fly compression tools such as mod_gzip or mod_deflate. Using gzip compression on the server can reduce page weight by up to 80%, gzip is available widely in most Apache installations, even on shared hosts.

I agree with Quadrille too that removing the white space makes editing much harder, and without gzip compression the difference in page weight would be small.

simonuk

2:26 pm on Mar 1, 2007 (gmt 0)

10+ Year Member



Personally I don't see the point in crunching. A good CSS design will not contain an huge amount of code.

If it does and you're worried you could code the html so the majority of your reader text is at the top and stick large portions of the coding below.

jdkuehne

8:41 pm on Mar 1, 2007 (gmt 0)

10+ Year Member



Personally, I do run my html through a code optimizer, but I think the benefit is greatly reduced in this age of broadband. As for editing the code, I'm doing that before compression - compression is the last step before upload. And if I do need to do a quick and dirty edit with the ftp client, I know the code well enough that it is not a problem to make minor changes in the compressed code as it sits on the server.

HelenDev

2:28 pm on Mar 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the info guys. I think I'll leave this one on the back burner.

piatkow

11:04 am on Mar 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I used to worry about this in the days of 28k modems but stopped bothering back when I got a 56k.

g1smd

11:10 am on Mar 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I often crunch before publish but always keep the uncrunched code to edit next time. I do not keep a local copy of the crunched code.

In fact I usually keep all uncrunched old back-copies of websites that I work on. You never know when you'll need an old page again.

penders

6:29 pm on Mar 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Has anyone had their CSS/pages "messed up" after they've been run through through a 'cruncher'? Is there a reliable CSS/HTML/JS cruncher that can be recommended? More of a curiosity.

The effect that such tools can have is minimal compared to on-the-fly compression tools such as mod_gzip or mod_deflate. Using gzip compression on the server can reduce page weight by up to 80%, gzip is available widely in most Apache installations, even on shared hosts.

Hhhhmmm, interesting! This prompted further research...
[http-compression.com...]

This very site [webmasterworld.com] appears to implement this, and after a bit of 'web sniffing' reveals that the encoded page (sent to the browser) is a little over 10KB, and once decoded is 56KB! That's quite a saving in download time and bandwidth!