Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Suppressing whitespace in ColdFusion with Railo

I've been meaning to blog this for a while.

When it comes to getting rid of the amazing amount of whitespace CF can generate in your page there are quite for tricks to getting around this from multiple tags to server filters that you can use.

With Railo its a little more simplier. Log in to your admin panel, go to "Output" in the left hand side and check "Whitespace management: Removes all white spaces in the output that follow a white space".

Comments Comments (7) | Print Print | Send Send | 810 Views

(Comment Moderation is enabled. Your comment will not appear until approved.)
What will this do within a cfmail tag using a plain text format?
Tom k's Gravatar Posted By Tom k @ 10/27/09 11:41 PM
I wonder what the overhead is like with this turned on?
@Ray: It will do nothing to it since it only affects the response stream. All the whitespace that is generated there will be affected but not the rest.

@Tom K: We cannot really measure it since the amount of time it takes is outperformed by the lower load time it has since it's only transferring less bytes. Of course if you otherwise would transfer tons of data, it would be very effective.

Just as a background info: Railo checks the response stream and supresses every whitespace that follows a whitespace.

Gert Franz
Railo, Switzerland
@Ray CFMAIL tag is unaffected

@Tom I wouldn't expect to much but that might be a question for the Railo Google Groups to see if any of the dev team can help with whats involved
I somehow dont agree with a few things, but its great anyways.
just like to add that there is a slight danger with this feature - it can mangle output in textareas. well, mangle is a bit strong, but it'll get rid of the all the extra newlines. probably not a problem for most but it is something to watch out for.

unfortunately there's a known bug in Railo where using cfsetting to stop it adjusting the whitespace doesn't work once it's turned on at a server level. I started digging through the Railo source the other day to see if I could get to the bottom of the issue but it was too ambitious a project for the early hours of the morning :)
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .