[thelist] CF: Clearing a cached query?

.jeff jeff at members.evolt.org
Tue Oct 15 13:33:01 CDT 2002


ray,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Raymond Camden
>
> Plenty - if you need an easy way to clear the cache.
> Yes, you can run the query again w/ 0 timeout, but it's
> also just as easy to kill the variable using
> structDelete.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

just as easy to kill, but more of a pain and memory intensive to setup.  slapping it in a shared scope means you gotta lock the write.  you should copy it to a non-shared scope for any reads of if later.  the read to copy it should be locked.  now you've got two copies of the same data.  naw, that just seems like overkill.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Also - what if the menu is dynamic based on session?
> Normal query caching may not work well in that case.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

well, some might say that if the menu is that dynamic then maybe it shouldn't be cached at all.  after all, each new unique instance of the query will become a new cached query.  since you can only put a finite number of queries in memory, you could easily run into problems.  or, don't futz with caching in this situation and just have alot of database reads.  you'll probably get better performance by optimizing your database and sql, applying indexes wisely, etc. in this case.

i still think duplicating complex data should be avoided as much as possible.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list