[thelist] CF: Clearing a cached query?

rudy r937 at interlog.com
Tue Oct 15 11:42:01 CDT 2002


> BUT, i still find, that if i have more than one template accessing a
> query, there's probably a better way to do it that only needs to run
> the query once.

okay, here's my example

<CFQUERY NAME="navquery" DATASOURCE="#blogdsn#"
   CACHEDWITHIN="#CreateTimeSpan(0,1,0,0)#"
   BLOCKFACTOR="100" >
  select nav.id           as navid
       , nav.catseq       as navcatseq
       , nav.catlink      as navcatlink
       , nav.catname      as navcatname
       , subnav.id        as subid
       , subnav.catseq    as subcatseq
       , subnav.catlink   as subcatlink
       , subnav.catname   as subcatname
    from category nav
       , category subnav
   where nav.cattype='nav'
     and nav.catsite='#domain#'
     and nav.catcatid is null
     and nav.id = subnav.catcatid
order by nav.catseq
       , subnav.catseq
</CFQUERY>

the purpose of this query is to get my site's navigation structure

this query is called on every page in my site

(well, every page that has a nav bar, to be exact)

if i change the database, every page's nav bar is changed

after an hour, that is   ;o)

and please don't tell me how to load stuff like this into session or
application variables <grin>



> ...  for future readability, i like to just keep it in my action
template.

i cannot see doing that for nav bar data, state codes, latest news lists,
etc.

one-of-a-kind queries, well, okay

maybe i just have more reusable than one-of-a-kind queries   ;o)


rudy




More information about the thelist mailing list