latest reactions

spider
One way is to google for page which cont …
andy
you can find this tool here http://andy. …
Tjarko
Eej Walker, that's pretty cool, I will c …
Walker
Thanks for posting your thoughts. I modi …
Albert
Thanks !! …

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

CF101 Archive: September 2007 Object Oriented PizzaJob Opening for ColdFusion Developer at Arizona State UniversityMy New Experience Getting ColdFusion Builder 2 Console WorkingCF101 Archive: February 2007 Data Table GatewaysJob Opening for Sr. ColdFusion Developer in CA/ San Fernando ValleyColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)Best wishes for the new FuseboxCF101 Archive: January 2007 Data Access ObjectsOpen Source Conference For CFML DevelopersSkype Blocking Web Services with IIS, ColdFusion & RailoCF101 Archive: October 2006 Five Cool Things with ColdFusionGenerate a tag cloud from an RSS feed with ColdFusionColdFusion MeetUp: Cloudy with a Chance of Tests, with Mike HenkeReminder - Adobe CookbooksCF101 Archive: September 2006 A first look at FusionDebug

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2012 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Strip whitespace

After reading a comment from Dmitry Namiot that he posted on http://weblogs.macromedia.com/cantrell/archives/2005/01/eliminate_coldf.cfm, I tried it out.. but it didn't do what I wanted. Below I changed the code a bit so that I have all the control on what to strip and what not. I didn't want the code to be on 1 line.. for that you can just use the regular expression. "[[:space:]]{2,-}"... I wanted to have a certain control on what and how my code was stripped.

Put the code below in an onRequestEnd.cfm and see what it could do for your bandwidth!! A better solution is always welcome :-)

Oh.. and the servlet idea on the above post didn't do it for me.. it had problems with RDS, cflocation etc, etc.


<!--- copy the current contents of out (which is what cfmx will send to the browser at the end of processing) --->
<cfset pageContent = getPageContext().getOut().getString()>

<!--- now we have a copy, clear the out buffer --->
<cfset getPageContext().getOut().clearBuffer()>
 
<!--- tidy up --->
<cfset pageContent = reReplace(pageContent, chr(9),"", "all" )>
<cfset pageContent = reReplace(pageContent, " ","", "all" )>
<cfset pageContent = reReplace(pageContent, chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10), "all" )>
<cfset pageContent = reReplace(pageContent, chr(10)&chr(13),"", "all" )>
 
<!--- send our cleaned content to the browser --->
<cfset writeOutput(pageContent)>
<cfset getPageContext().getOut().flush()>
<!--- job done! --->

5372 viewed | Your opinion...  | del.icio.us | Digg it | Tjarko @ 12/09/05 12:58 cet


Reactions:

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!