Removing white-space characters
Posted: Sat Dec 18, 2004 9:39 pm
I was just viewing the source of my "mylist", it turned out to be 5.05MB, fully expanded (gosh, I'm glad you're using gzip), but it was still 216kB, which takes a good 'ol while to load, usually. What i noticed was the massive amount of white-space characters in the code.
I decided to check my friends mylist instead of mine, to save some time.
ungziped his list was 256kB (expanded once).
After removing all tabs, i got it down to 244kB.
After removing all extra spaces, 239kB
After removing all newlines, 232 kB
This got the filesize down 22kB, 9.4%.
I imagine it the file size would go down even further, due to further indenting, if the list was fully expanded.
In my opinion it would be worth the effort to remove all white-spaces and new-lines, before uploading it to the web. Either by removing all formatting server-side, or using a code trimmer (I know W3 has their own, can't recall the name of it though).
So, what do you all think?
I decided to check my friends mylist instead of mine, to save some time.
ungziped his list was 256kB (expanded once).
After removing all tabs, i got it down to 244kB.
After removing all extra spaces, 239kB
After removing all newlines, 232 kB
This got the filesize down 22kB, 9.4%.
I imagine it the file size would go down even further, due to further indenting, if the list was fully expanded.
In my opinion it would be worth the effort to remove all white-spaces and new-lines, before uploading it to the web. Either by removing all formatting server-side, or using a code trimmer (I know W3 has their own, can't recall the name of it though).
So, what do you all think?