<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nerd Fusion &#187; Best Practices</title>
	<atom:link href="http://nerdfusion.wordpress.com/category/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdfusion.wordpress.com</link>
	<description>If my family won't let me talk about this stuff, I guess I have to blog.</description>
	<lastBuildDate>Wed, 09 May 2007 17:18:41 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='nerdfusion.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b5b0131ae6041f674b1b73e34231f9e5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Nerd Fusion &#187; Best Practices</title>
		<link>http://nerdfusion.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nerdfusion.wordpress.com/osd.xml" title="Nerd Fusion" />
		<item>
		<title>Optimizing your application.cfm</title>
		<link>http://nerdfusion.wordpress.com/2007/04/27/optimizing-your-applicationcfm/</link>
		<comments>http://nerdfusion.wordpress.com/2007/04/27/optimizing-your-applicationcfm/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 11:07:19 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://nerdfusion.wordpress.com/2007/04/27/optimizing-your-applicationcfm/</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfusion.wordpress.com&blog=1022394&post=5&subd=nerdfusion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>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.</p>
<p>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.</p>
<p>In short, this is bad code:</p>
<p><code>&lt;cfapplication name="myApp"&gt;<br />
&nbsp;&nbsp;&lt;cflock scope="application" type="exclusive" timeout="30"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;cfset application.myvar="25"&gt;<br />
&nbsp;&nbsp;&lt;/cflock&gt;</code></p>
<p>And this is good code:</p>
<p><code>&lt;cfapplication name="myApp"&gt;<br />
&nbsp;&nbsp;&lt;cfif not isDefined(”application.varsAreSet”)&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;cflock scope=”application” type=”exclusive” timeout=”30″&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;cfset application.myVar=25&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;cfset application.varsAreSet=”true”&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/cflock&gt;<br />
&nbsp;&nbsp;&lt;/cfif&gt;</code></p>
<p>I am planning on posting additional application.cfm optimization techniques next week &#8211; focusing on how best to make a single application.cfm that works in all of your environments, and as always, welcome questions.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfusion.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfusion.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfusion.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfusion.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfusion.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfusion.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfusion.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfusion.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfusion.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfusion.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfusion.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfusion.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfusion.wordpress.com&blog=1022394&post=5&subd=nerdfusion&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nerdfusion.wordpress.com/2007/04/27/optimizing-your-applicationcfm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3436f5af3f90295fb68569bf0fba1dac?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Adam</media:title>
		</media:content>
	</item>
	</channel>
</rss>