[thelist] CF: Clearing a cached query?

rudy r937 at interlog.com
Tue Oct 15 18:24:01 CDT 2002

> i'd personally just stick with the cached query.

thanks for the sanity check, jeff

i agree, the simpler the solution the better (usually)

i think i'll try parameterizing the timespan

if that works to clear the cache, then i will modify the template to, i
dunno, test for the existence of, say, a specially named variable in the
url, maybe http://r937.com/foo.cfm?athousandflushes=yes

if i name it carefully, nobody will guess it and flush my cache on me, eh

> it's something you won't have to figure out months later
> when you want to change something.


the simpler the solution the better (usually)

for this reason, i consider it an achievement that i have so far not had to
resort to using application variables -- or even custom tags

i do have session variables turned on (and my site tries to write a cookie)
but this was originally conceived just to support "remember me" logic,
which was supposed to let you pick a preferred style sheet for whenever you
visit my site -- it might help if i'd actually bother to offer more than
one style sheet   ;o)

ray's comment "Also - what if the menu is dynamic based on session? Normal
query caching may not work well in that case" is an interesting point

as i understand it, there would be N query results cached, even though they
originated from the same piece of code

suppose each time this query runs, a different value of bar is used:

    <cfquery name="cachedqueryname">
        select stuff from sometable where foo = #session.bar#

that makes each result a different cache entry, right?

i can still see the usefulness of caching this, assuming there is still a
justification for potential sharing

for instance, if it's just joe public versus the site administrator,
there'd only be two versions in cache, and the thousands of hits by all the
joe publics would all get their results from the cache -- the admin would
get a separate cached result, but so what

however, if you had a query where the results were separate for each unique
visitor, i doubt you'd want to cache that...


More information about the thelist mailing list