Well, my thought was as follows:

People visit the front end and set the query into cache.
More people visit the front end and see cached query.
Admin user goes into backend and inserts a new record.
At the bottom of the code where I insert the new record, I do the select
query and set createTimeSpan value to 0.
Admin user goes to the front end and loads the page.

At the last step, will that not re-call the query and then cache it with
the correct timespan?

Will all of this work if my front end and back end are in 2 different
application names? (Application.cfm in each with a <cfapplication
name="frontend"> for the front end and <cfapplication name="backend">
for the back end)  Is there any way to clear caches outside in a
different application than you're currently in?

John

-----Original Message-----
From: Dave Carabetta [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 10:19 AM
To: CF-Talk
Subject: RE: Cached Queries

>Is there any way to clear just individual queries?  Would the best
>method for doing that be to execute the same query and give it a new
>cachedwithin value of #CreateTimeSpan(0,0,0,0)# to kill the cache from
>the backend and then when the frontend query is called again, it will
>reset the cache?  I'm just curious how CF differentiates cached
queries.
>If the front end has one application name and the backend has another,
>does it handle the cached queries separate even though they're the
>exact same query?
>

While setting a createTimeSpan value of 0 will indeed work, the results
won't take effect until the *next* page request, I think. In the above
scenario, you'd be relying on somebody hitting that page again before
showing the proper results (even if you just hit Refresh in your
browser, you still have to load the page twice to achieve the desired
result).

Regards,
Dave.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to