mokaplanjr
Technical User
I use the application.cfm template to set global variables (fonts, colors, etc.) using the tag <cfset application.variable = "#data#">. The values of each variable come from a query of a table in the database.
I set about 30 variables this way and my ISP says this is bogging things down.
He said that I should use <cfscript> to set the variables from the query whenever there are more than 3 consecutive <cfset> tags. Something like:
<cfscript>
request.thing1="#query.thing1#";
request.thing2="#query.thing2#";
request.thing3="#query.thing3#";
request.thing4="#query.thing4#";
</cfscript>
I have seen nothing in docs or books that support this, but we have been getting some performance problems. The docs I have read state that <cfscript> was invented for those quite comfy working in a scripting lanquage environment, rather than tag-based, but nothing about performance.
Also, is there any convention in naming the variables? I had originally named them "application.whatever" and he suggested "request.whatever", but I don't see any specific attributes required in the Big Blue Book O' CFML.
I ask this question with all due respect to the ISP's staff, but I'd like to see what other folks have run into in this regard.
I have set up a new template, complete with freshly-named application and cached query. Just seeking advice before I bring down the house (read: "server" again.
I set about 30 variables this way and my ISP says this is bogging things down.
He said that I should use <cfscript> to set the variables from the query whenever there are more than 3 consecutive <cfset> tags. Something like:
<cfscript>
request.thing1="#query.thing1#";
request.thing2="#query.thing2#";
request.thing3="#query.thing3#";
request.thing4="#query.thing4#";
</cfscript>
I have seen nothing in docs or books that support this, but we have been getting some performance problems. The docs I have read state that <cfscript> was invented for those quite comfy working in a scripting lanquage environment, rather than tag-based, but nothing about performance.
Also, is there any convention in naming the variables? I had originally named them "application.whatever" and he suggested "request.whatever", but I don't see any specific attributes required in the Big Blue Book O' CFML.
I ask this question with all due respect to the ISP's staff, but I'd like to see what other folks have run into in this regard.
I have set up a new template, complete with freshly-named application and cached query. Just seeking advice before I bring down the house (read: "server" again.