As most people who use Mach-II knows, it inserts a lot of white space at the top of your website. This can be significant! I was getting several thousand characters of white space at the top of some of my applications and decided that was a bad thing. So, I took action against it.
The first thing I did was go though all of my components and double check that all of them have output=”false” in all methods. Some didn’t, I fixed that. I also added output=”no” into the cfcomponent tag itself. I also did a few other things to remove the vast quantities of white space. Even after all of my efforts I was still getting between 4000 and 7000 characters of white space in front of all my pages.
Finally, just to see what would happen, I wrapped the call to the Mach-II framework in my index.cfm in a cfsavecontent. I then simply output the trimmed value of that content like this:
<cfsavecontent variable="content"> <cfinclude template="/MachII/mach-ii.cfm" /> </cfsavecontent> <cfoutput>#trim(content)#</cfoutput>
Viola! Much smaller files and almost no leading white space. How happy I am.