Fusebox Application Scope Variables

As with any application, there are many choices for where to place your application variables. And while Fusebox is a framework which provides some nice places for such variables, most of the common logic is the same.

Lets start from the top

Application variables are a great way to store site-wide variables that rarely need to change. The Application scope should NOT be used for variables that are modified frequently, and most certainly not on every page load.

  • for more information on Coldfusion Variable Types, click here.

Where do they go?

Within the Fusebox Framework you have a couple of nice options for your Application Scope Variables, here is a list in no specific order:

  • fusebox.appinit.cfm
  • <appinit> global fuseaction in fusebox.xml

fusebox.appinit.cfm

fusebox.appinit.cfm is called immediately when the framework is first loaded, before the request is compiled and processed and is again within a lock. It is also locked with a different named lock from <appinit>. For more information, view the Fusebox.appinit.cfm wiki page.

<appinit> global fuseaction

You will find the <appinit> global fuseaction in the fusebox.xml file, located in the <globalfuseactions> XML node as follows:

<globalfuseactions>
<appinit>
...
</appinit>

<preprocess>
...
</preprocess>

<postprocess>
...
</postprocess>
</globalfuseactions>

This processing phase occurs within the Fusebox Framework at the first request for this application or the application was reloaded. For more information on how the Fusebox Framework processes requests, see the Fusebox Framework processes wiki page.

Additional Information