The most important when you write a web application is that it's error free and that it's fast.
I will give you a few tips how you can speed up a coldfusion webapplication.
When programming:
- Keep the coldfusion web application small, which means that you should use often cfinclude. Coldfusion reads many small applications gathered together much faster then one big application.
- Use cffile instead of cfhttp when possible.
- Reduce database access, use cachedwithin whenever possible.
- When you need a file more then once using cffile, save the file as a application variable.
<cfparam name="Application.xmlexpire" default="#Now()#">
<cfif DateCompare(Now(), Application.xmlexpire) gte 0>
<cffile action="read" file="/home/xml/xmlfile.xml" variable="xmlvar">
<cfscript>
Application.xmlfile = XMLParse(xmlvar);
Application.xmlexpire = DateAdd("d",1,Now());
</cfscript>
</cfif>
<cfset xml = Application.xmlfile> - I will add more tips in a while...
Reacties