> I'm writing a web app that acts as a dashboard for an MSP, i.e. a GUI that
> shows the status of all sorts of applications, network and  host
> devices.  I
> need to write quite a few select queries for each device/host/app type, so
> will end up with ~150 different queries.
>
> What I'm wondering about is if anyone has any thoughts on whether it's
> better to access these queries from the GUI templates using
>
> - a series of conditional CFINCLUDE's that would include a smallish query
> template.
>
> - or write a custom CF tag with all the queries inside and pass three
> parameters that would give me a unique query name.  A three deep CFWITCH
> statement could home in on the relevant query.
>
> Is it correct to assume that it's a bigger hit on CF to call on a
> relatively
> large templates even though it's doesn't have to process much of it (cf_
> tag), as opposed to including whole but small templates?
> I guess it may be better organizationally to implement the queries as a
> bunch of small files to include?
>
> It seems like a case of six in one, half a dozen in the other but
> I'll never know if I don't ask...

OK, here's a few things to remember about how CF works with templates;

Once they're converted to PCode, they are stored in memory (cached) until
either CF runs out of cache (and the oldest template gets shunted) or a
newer version is uploaded

If you turn on Trusted Cache, then it'll NEVER check to see if a newer
version is there

Speed wise, a CFINCLUDE is faster than CF_ or CFMODULE, the reason is that
the CFINCLUDE actually (theoretically) puts the code into memory in one
file, and then executes the whole thing (it's not actually how it works, but
it's close enough) - CF_ and CFMODULE are different instances of CF (which
is why the Variables scope doesn't follow through) - I'm not sure if this is
still 100% true of 4.5.2, but it definitely was for 4.0.1 and 4.5.1

Now onto queries - Cache them! If they're not being changed on a regular
basis (such as State lists), then they won't change often, so why load them
all the time?

Erm, can't think of much more, but this should help you a bit

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to