Archive for ColdFusion

This blog has moved!

Due to the limitations of using a free WordPress.com blog, and the fact that I already have a webserver with available space, I’ve decided to move this blog to a new home: http://tuttletree.com/nerdblog/

I will miss being listed in the RSS feeds for the Coldfusion tag, etcetera, but in this case the juice is worth the squeeze.

Leave a Comment

Bummer! No CFUnited for me!

I need to learn not to get so excited about tentative plans until they are more firm. As it turns out, my involvement with my current project is so “crucial” (in my boss’ terms), and the schedule is so tight, that we can’t afford the time off to send me to CFUnited, even though the location is right, the cost would be justified, and the content would be beneficial. I suppose there’s always next year – and with any luck it’ll be somewhere more exotic.

In the meantime, I’m looking for a conference to attend this fall instead; and I’ll have to try to get my fill of Scorpio information from the May 15th presentation.

I’ve been working on the follow-up to my application.cfm tweaks post that I promised, but I am somewhat deterred until I find an adequate solution for posting code. Perhaps I’ll just use codeShare and then update it later when I find a more permanent solution.

Leave a Comment

The anticipation is nigh unbearable!

Dave Shuck has a great writeup on the Scorpio (ColdFusion 8) presentation by Ben Forta to the Dallas Fort Worth CFUG – link via Steve of the Philly CFUG – detailing the new tags and attributes presented. Dave reports that Ben plans to show more and more features as his presentation tour goes on, which only makes me more excited to see what else will be unveiled at the Philly presentation on 5/15. Obviously I’m planning on attending, and I will be sure to take notes based on Dave’s writeup, as well as report back on anything new unveiled to us.

Leave a Comment

Optimizing your application.cfm

Because application.cfm is called on every request, it is extremely important that it be succinct, efficient, and optimized. Besides containing hundreds of lines of code, the worst and most common faux-pas I’ve seen among my clients is setting all of your application variables on every request.

Global availability within your application and the fact that they are stored in memory long term are the two greatest advantages to using application variables, and if you are resetting their values on every request you’ve eliminated half of those. You should instead check for the existence of your application variables and, if not found, reset them.

In short, this is bad code:

<cfapplication name="myApp">
  <cflock scope="application" type="exclusive" timeout="30">
    <cfset application.myvar="25">
  </cflock>

And this is good code:

<cfapplication name="myApp">
  <cfif not isDefined(”application.varsAreSet”)>
    <cflock scope=”application” type=”exclusive” timeout=”30″>
      <cfset application.myVar=25>
      <cfset application.varsAreSet=”true”>
    </cflock>
  </cfif>

I am planning on posting additional application.cfm optimization techniques next week – focusing on how best to make a single application.cfm that works in all of your environments, and as always, welcome questions.

Comments (2)