> You will probably get a lot of responses on this. I assume 
> this is a CF application if so there are several ways to cache 
> content-queries etc. The simplest way is to turn on "Trusted 
> Cache" in CF Administrator and for prudence upsize the "Template 
> Cache Size" depending on what it is currently set to and how 
> much RAM is available. By doing this each CF page is cached
> after the first hit and stays there until Trusted Cache is 
> turned off and the server restarted, no hits to the database 
> for cached pages. This way the manager gets their wish 
> fulfilled without taking such a disastrously unnecessary step.

Unfortunately, this is incorrect. Using "Trusted Cache" doesn't have
anything to do with database queries.

By default, when the CF Server runs a page for the first time, it reads the
contents of the ASCII text and converts those contents to what is commonly
referred to by Macromedia as "p-code". This "p-code" can be thought of as a
"native" version of the instruction set originally contained within the
ASCII text. By default also, the CF Server caches this instruction set in
memory. You can specify the size of the memory allotted for storing cached
instruction sets in the CF Administrator.

Now when the page, once cached, is subsequently executed again, the CF
Server fetches the instruction set from the cache and executes that,
skipping the original step of parsing the ASCII text. However, whatever
instructions are contained within that set are reexecuted - database
queries, HTML output generation, and so on.

By default, before the cached instruction set is reexecuted, the CF Server
checks the original ASCII file to see whether it has been changed since the
instruction set was generated. This requires some disk access overhead,
which is generally unnecessary in a production server environment. So, to
avoid this overhead, you can enable "Trusted Cache" in production, and the
CF Server won't check the file on disk for changes once it has a cached
instruction set. Any database queries within that instruction set will be
reexecuted each time the page is run, though.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to