title: ColdFusion speed cost of FileExists
body: <p>I want to:</p>
  
  <ul>
  <li>on every page,</li>
  <li>check if a file exists</li>
  <li>include that file if TRUE</li>
  </ul>
  
  <p>i.e.:</p>
  
  <pre><code> &lt;cfset variables.includes.header = ExpandPath("_inc_header.cfm")&gt;
   &lt;cfif FileExists(variables.includes.header)&gt;
     &lt;cfinclude template = "_inc_header.cfm"&gt;
   &lt;/cfif&gt;
  </code></pre>
  
  <p>Is this a good idea?</p>
  
  <p><strong>edited</strong> to use just "_inc_header.cfm" as the template</p>
  
  <p>Alternative practical use would be something akin to this PHP code:</p>
  
  <pre><code>foreach (glob("includes/*.php") as $inc) {
     require($inc);
  }
  </code></pre>