[thelist] Design check: stinkfactor.com

Michael Buffington mike at stirlingbridge.com
Tue Jan 29 12:52:08 CST 2002


I posted this late last Friday night but didn't get much/any response so
I thought I'd give it another shot:

I'm looking for ideas to make the front page of www.stinkfactor.com a
little more compelling, a little more intuitive.

Also looking for any constructive criticism about any part of the site.

Thanks!

Michael Buffington
ColdFusion 5.0 Developer's Guide ISBN:072132256
Macromedia Certified ColdFusion 5.0 Developer
http://www.michaelbuffington.com


<tip type="ColdFusion" author="Michael Buffington">
Looking to roll your own query caching in ColdFusion? Put your queries
in the application scope:

<cfquery name="application.queryname">
...
</cfquery>

The entire result set can be accessed by always referring to the query
object as application.queryname.

If the query already exists, you can avoid rerunning it:

<cfif NOT IsDefined("application.queryname")>
   <cfquery name="application.queryname">
   ...
   </cfquery>
</cfif>

This method of "caching" has it's pros and cons.

Pro:
It's easy to purge a cached query by forcing the query to run again:

<cfif NOT IsDefined("application.queryname") or url.purge eq 1>
   <cfquery name="application.queryname">
   ...
   </cfquery>
</cfif>

Con:
ColdFusion's built in caching caches the actual SQL statement and it's
result set, rather than just the query object. Application scope caching
will not detect a changed SQL statement (which might also result in a
different set of results).

Cached application scope queries will expire based on the time set in
the <CFAPPLICATION> tag of the application.
</tip>







More information about the thelist mailing list