Removing white-space characters

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Locked
raevel
Posts: 8
Joined: Sat Jul 31, 2004 3:51 pm
Location: Sweden
Contact:

Removing white-space characters

Post by raevel »

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?
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

well,

the problem there is that some browsers do indeed take whitespaces into account when rendering the page.
so simply stripping all whitespaces may well corrupt the layout for some browsers.

the way the html code is currently generated it's also not that easy to strip all whitespaces.
however a switch to a css based layout might already take care of the whitespace problem.

BYe!
EXP
Locked