Get a Quote Today!   |   + 1 (301) 424 3903




 
  Community
 
Need Help?
Visit our Training page
Request a Quote or Consultation
SIGN UP FOR THE TERATECH NEWSLETTER
 

ColdCuts

Cut: Cutting Out White Space
Cut#: 119 
Cut Date: 04/17/2000 
Cutter: Joel Cass 
Topic: Appearance 
Overview:

All our webpages have excessive whitespace through them, most of which cannot be prevented due to a lot of our code being in includes, and the style of the code itself.

I have made a custom tag which will take out *all* whitespace. The cutdown in filesize is great, unfortunately the server is hampered. Is there a better solution that we may have missed?

 

Cut Code:
Something worth noting is that when you do a replace for one single
character, it turns out hellishly slower than doing a replace for multiple
characters. ie on one of our pages:

ReReplace(thistag.generatedcontent, "[#chr(13)##chr(10)##chr(9)#]",
"#chr(10)#","ALL")
30 seconds

ReReplace(thistag.generatedcontent,
"[#chr(13)##chr(10)##chr(9)##chr(32)#]{2,}", "#chr(10)#","ALL")
0.7 seconds