Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

From what Geoff said about improving

Excerpt

You can improve (production)

preformance, I have turned

performance by turning on trusted

template cache in cfadmin.

But everytime I do a Farcry update app I forget to flush the cache first (sad)

So here

cache for your ColdFusion server. However, it's easy to forget that trusted cache is on when you do an update. Here is how to add this functionality to

theFarcry Webtop (only tested in CF8).

the FarCry Webtop so you can flush cache when you re-initialise the application.

Tip
titleTested in CF7, CF8, and CF9

Code Block
title(project or plugin)\packages\forms\UpdateApp.cfc
<cfcomponent displayname="Update App" 
             hint="Provides a granular way to update parts of the application state"
             extends="farcry.core.packages.forms.UpdateApp" 
             output="false">
       
    <cfproperty ftSeq="101" 
                ftFieldset="ColdFusion" 
                name="cfCache" 
                type="boolean" 
                default="0" 
                hint="Flush ColdFusion Trusted cache" 
                ftLabel="Flush Trusted Cache" ftType="boolean" />

    <cffunction name="processCFcache" 
                access="public" returntype="boolean" 
                description="Reload PSL Service" 
                output="false">

        <cfset var adminObjoCFAdmin = createObject("component","cfide.adminapi.administrator").login(application.fapi.getConfig('coldfusion','password')) />
        <cfset var oRuntime = createObject("component","cfide.adminapi.runtime") />

        <!--- Clear trusted cache --->
        <cfset oRuntime.CLEARTRUSTEDCACHE(clearTrustedCache() />
        <!--- Stop and restart trusted cache --->
        <cfset oRuntime.setCacheProperty("TrustedCache", 0) />
        <cfset oRuntime.setCacheProperty("TrustedCache", 1) />

        <cfreturn true />
    </cffunction>

</cfcomponent>
Code Block
title(project or plugin)\packages\forms\configColdFusion.cfc
<cfcomponent extends="farcry.core.packages.forms.forms"  
             key="coldfusion" 
             displayname="ColdFusion Config" 
             hint="ColdFusion Server" 
             output="false">
    <cfproperty ftSeq="1"
                name="password" 
                type="string" 
                default="" 
                hint="Password for accessing CF Admin API"
                 ftSeq="1ftHint="Password to allow FarCry access to the CF admin API" 
                ftFieldset="Server" 
                ftLabel="CF Password" 
                ftType="password" 
                ftRenderType="editpassword" 
                ftstyle="width:500px;" />
</cfcomponent>