Like Hamid Said, if the ColdFusion server has the query already in memory. It doesn't need to send traffic to another server to get the information again. Most systems I've worked on have the db and the web server on different areas of a firewall, so you're going through a lot of excess steps if you're hitting the db every time for something that won't change.
The problem I have with this is where the database DOES change, and not on any set interval. I used to work at Insight, and our product database changed constantly, at any give moment to account for pricing changes, stock changes, specials, updates from places like TechData, etc. If I'm caching the results of my query, I miss those updates, and have a customer placing an order for a product at the wrong price, out of stock, etc.
Now I can somewhat understand the use of this on a db that rarely changes, depending on how often rare is. Or in a case where the db is updated at a set time. Still, if rare is a time period of months, why have a db anyway? Static HTML would be faster than php, cold fussion, etc. And if the db is updated at a set time, what happens when I have to push a change out that is outside of the set time?
Maybe it's just me, but I feel that the db is supposed to handle the dynamic data, not the web server.
Plus, you have a granular control on what is being cached. The sql server will only cache what it has room for. So if enough queries are run against it, the original query won't be cached anymore regardless.
But I think the original question was about a tree that took a long time to create, and application variables would be a plus in this situation.....
Marlon (another certified cf developer)
-- By-Tor.com It's all about the Rush http://www.by-tor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php