-
Notifications
You must be signed in to change notification settings - Fork 24
How can I reduce or eliminate any whitespace the framework produces?
Note: As of Mach-II 1.8, the whitespace generated by the framework has been virtually eliminated.
Mach-II (as well as other frameworks) produces some white space before and after your source when viewed in a browser. This technique is especially effective when your application uses layout views as templates for displaying content. At the top of your layout view, the following line of code on the same line of your doctype:
<cfcontent reset="true" /><! DOCTYPE html ... />
At the end of your layout view put:
<cfsetting enablecfoutputonly="true" />
Some of the whitespace could be due to your CFML engine configuration. Check to see if you have "Enable Whitespace Management" checked on the "Settings" page or similar setting in the administrator. This is also known to speed up requests in Adobe ColdFusion because it no longer has to create a string buffer for all that has been whitespace generated.
Voilà and you got super clean output! By the way, this would apply to other frameworks like Model-Glue.