ColdFusion and Whitespace - Part 2

Continuing on the ColdFusion whitespace hunt, your next weapon is the <cfsilent> tag. This is my personal favourite as it is the most straightforward. You just wrap the cfslient tag around anything and it tells ColdFusion not to output anything to the browser from within it.

<cfsilent>
... something that has a lot of whitespace in it ...
</cfsilent >
It also has its own little trap, it does exactly what is said it would - it does not return anything from with in it, so you have to be a little be careful when debugging as you can often get trapped trying to output hints or the contents of variables to your web page and not see it.

Moving onto the cfprocessingdirective tag. This could be the most complicated way of getting whitespace out of our code. Like the cfslient tag, you will need to wrap the code that you want to bring under control

<cfprocessingdirective suppressWhiteSpace = "True">
... your code goes here ...
</cfprocessingdirective>
This tells CF to suppress the whitespace characters that are generated by CF. The good news is that if you need to actually include the whitespace you can nest the cfprocessingdirective tags and turn whitespace suppression off again. ( I am still looking for a good reason to do this though)

Next, using java to control the output buffer.

ColdFusion and Whitespace - Part 1

I know quite a few CF developers who are happy if their code runs, then there a the developers who watch the time that it takes for their code to run, down to the millisecond to make sure that their site is as fast as it can be but there is more to a web page than the time it takes to execute. Of course, this is important but there are other things that can speed up or slow down your page beyond your CF code.

The most often forgotten is whitespace. It is all the extra space that is in between your HTML code, typically it is just tabs, spaces and new line characters but these all add up when it comes to the size of the page that you return to the browser. If your page is 100k and 10% of it is whitespace. If you remove this extra 10k, you can get an easy performance jump from your server - it will be able to output 10% more html without using any more bandwidth. Simple math really.

Over the next few days, I want to dig into a few different things you can do to keep it down. The first and most easiest thing to do is to turn on the 'Enable Whitespace Management' feature inside the ColdFusion Administrator (it is on the settings page) This is basically a must have for any production environment. Like every setting you do need to consider how much of a performance impact this will have on your app but I have never found this to be enough of a load to warrant it being turned off. In your development environment however, this is something you will want to keep turned off. You will want to see just out much whitespace your code is pumping out without it so you can go to work on it at the source. The next thing to add to your arsenal is <cfsetting enablecfoutputonly="yes">. This tells ColdFusion to only return to the browser things inside tags. There is one drawback to this technique is that it cascade down through a request. Why does it do this? Well it is a setting, so it is turned on and off at the request level. If you turn it on (or off) in an include or a custom tag, it will affect the whole request. To make things a little more confusing, it is also accumulative, if you turn it on twice in one request, then you will need to turn it off twice in the same request before ColdFusion will behave like normal. So the best thing to do is make sure you turn enableCFOutputOnly at the end of any file that you turn on in.

On the ever present performance question, yes this does impact performance, again not by much but you do need to understand what is happening if you wrap every last bit of HTML code in an output tag to ensure that it makes it to the page. The tag tells CF to look closely at this and try to execute it. Now this is only affects the first load of a page, when CF complies it to java byte code, so if you notice it, you are doing better than me!

Tomorrow, in the next post, we will tackle cfsilent and cfprocessingdirective...

BlogCFC upgrade

I thought it was about time that I upgraded to the very latest. BlogCFC5 has been out for almost 10 days now and it is already up to version 5.003 already.

I have been putting off as the new design is all CSS and I wanted to have time to make it look like the old version of the blog but not add too much weight to the pages (to make it easier to upgrade next time arround.

In the end I mannaged to get away with just copying across the additional pods and adding one div the the page layout, all the rest is pure css changes.

Once again Ray, thanks for a great piece of cool code!

The ColdFusion bounty hunt continues...

It is one day after the launch of the ColdFusion Developer Bounty hunt and we are still looking.

I know that it takes time for things to trickle through the internet so I am not getting my hopes up just yet. There have already been quite a few questions from all over the place, Brisbane to Melbourne and as far away as London but no resumes! So in answer to your questions...

  1. Is this real? Yes most defiantly. I need a CF developer! Yes, the position real. You can find it on Seek.com.au (minus the bounty)
  2. I am a recruiter; can I find you a candidate? Yes of course! Recruiters are the modern day bounty hunters! The bounty is still the same; no additional fees will be paid.
  3. Is this really real? Once again, most defiantly yes. There are enough internet stunts that have worked (just look at the red paperclip) this is no different.

Tell your friends, tell everyone - the bounty is waiting to be claimed.

ColdFusion Developer Bounty

It appears that it is the season for CF developers in Australia at the moment. There are CF positions being advertised in Melbourne and Adelaide and even in Newcastle at Teligence! It is great to see this nice new interest in CF developers. We have just taken on another CF junior and are about to start training them up (It is nice to have a CF instructor in house)

With 80 odd CF positions currently on Seek around the country, I get just a little concerned for our own team, so whilst we are on the recruitment drive, lets keep going... I know most people who might read this are really happy with their current CF position but I know you all know someone who might not be so happy.

So here is the deal, RedBalloon is an Experience company and I want to share the love - if you find me the perfect CF developer, I will ensure that you get an experience you will not forget, Jet Fighter flight sound good? Find me a senior CF guru! Know an up and coming CF legend? V8 hotlaps it is for you! I could go on but let it be know that the bounty is out there; Find Lucas a CF developer and you will be on an experience you will not forget in a hurry.

Yeah, gotta put some terms on an offer like this - there is only one experience available per SUCCESSFUL applicant and the value of the experience will be directly related to the value of the successful candidate. When that person starts, you will hear from me and we will work out something for you to do, right then on the phone!

Oh and the applicant doesn't miss out either - they will be working for RedBalloon, how could they possible miss out! We just took the entire IT team Jet boating last Friday (Ryan could not believe it, he has only been with us two weeks)

On to the position, I will take almost all comers but I am looking for a senior CF developer who can work full time in Pyrmont, Sydney, Australia. Someone who can tackle a project head on, someone know can help lead the rest of our team to greatness. We currently have 7 different projects that need work so there is no lack of variety of things to work on.

Skills? There is no long list here, just know CF 7 at a Guru* level - no minimum number of years experience (you can learn all you need to know about CF in 6 months if you don't sleep) but you will be asked as part of the interview process to prove that you do have what it takes to be a Guru. * All Gurus know about CFCs, the know about XML, they know about SQL and CSS.

Who is RedBalloon? We are a four year old startup that has been growing at 100% per year from day one. We work hard but we value balancing your work live and your personal life. We are driven and focused and you will always know where you stand and what you need to do today. We pay well and commit to your ongoing personal and professional skills development.

Know someone who fits the bill? Want to claim the bounty? Email me lucas @ redballoon .com .au now!

Know CF? Want to work on my team?

Unfortunately, one of our developers, Andy is moving to greener pastures, so we now have yet another spot for a ColdFusion developer.

Got Talent? Think you can cut it working with a very fast moving development team? We do at least one release a week so there is defiantly no time wasted.

We also play just as hard as we work, Andy has just come back from a shark dive and I have just taken a classic MGB away for the weekend all on the company's dime.

Sound interesting? Read on for the formal bit..

[More]

Where are all the CF developers?

Sean Corfield has started a frapper project to spot where all the ColdFusion developers are. If you have two seconds to spare head to frapper and the CF Develpers Map

UPDATE: Sean didn't start this - Neil Middleton of the feed squirrel did... my mistake, sorry Neil

Google sitemaps

I have been spending a few days working with getting Google sitemaps set up all over the place to help with our overall SEO efforts.

So why would you do this? Why create another file just for google. Well it really isn't that hard and the tradeoff is great, You get feedback from google as to what happens during its crawl.

How hard is it? Not so hard at all, here is a little snippet of our sitemap that lists the unique URLs to every single product page we have.

<cfsetting showdebugoutput="false">
<cfscript>
    oPM = createObject("component","core.productManager");
    qProducts = oPM.searchProducts(countryCode=application.countryCode,publish=1,returnFields="productCode");
</cfscript>
<cfcontent type="text/xml" reset="yes"><?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
    http://www.google.com/schemas/sitemap/0.84/sitemap.xsd"
>

    <cfoutput query="qProducts">
        <url><loc>/experience/#qProducts.productCode#</loc></url>
    </cfoutput>
</urlset>
Nothing too hard there?

So does it help? Well I am running two nice test cases at the moment. I have just launched a new blog for my boss and so far, it is not linked from anywhere at all, all I have done to promote it is tell google about its sitemap file (thanks ray, the sitemap file in blogCFC helped out there) and we will see how we go.

Playing with RSS

At RedBalloon we have been playing with RSS feeds of late, in particular product reviews. I know - nothing new I know. So why am I posting it I hear you ask?

Well I really want to see what google thinks of it and if this could be handy for our affiliates.

webDU Assets

sorry it took me so long to get this up. These are the files that go with my presentation from webDU.

Please if you have any feedback or bugs that you find, please let me know.

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.4.001. Contact Blog Owner