If you have gone to the trouble of working out whether it's time to flush
the cache because content has changed, you could just call
generatedcontentcacheflush to explicitly flush it. But anyway, that's not
the real problem.

Most people just want to say, cache this block of html for 6 hours. The main
reason that you want to cache something in spectra is that you don't want to
get the content, it's slow to get content and examine it (you are likely to
be hitting the database to get the content). Don't get me wrong, I can see
that there are places where the dtcachetimeout method in spectra could be
useful, but on the whole, I think that most people just want a simple
timeout, just like <cfquery>. The dtcachetimeout method is in my opinion
confusing to use, and unfortunately rather poorly explained in the docs.

Cheers,
Aaron.

/****************************************
Aaron Shurmer
Senior Developer
Daemon Internet Consultants
ph +61 (0) 2 9380 4162
http://www.daemon.com.au/
engineered.innovation
****************************************/
-----Original Message-----
From: Benjamin Elmore [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 8 August 2001 11:50 AM
To: Spectra-Talk
Subject: RE: Caching


Wait a minute...

ColdFusion provides this sort of caching in <cfquery> as well through the
cacheAfter attribute.

As for usages, let's see... This way of caching makes allows for both cache
for a period of time or until a period of time, while using the cachedwithin
attribute only allows caching for a period of time. For example, let's say
we want a page cached until the content is updated. Since we have no idea
how when the content will be updated I can't use cachewithin, instead I can
accomplish this by driving the dtCacheAfter attribute to the last time the
content changed. So if I change the content (pretend 8/7/01 01:00:00) and
cache a page with the dtCacheAfter set to the last time the content changed
it will rebuild the cache and give it a dt (pretend 8/7/01 04:00:00). Each
request will look to see if the page cache was created after the content was
created. 8/7/01 04:00:00 > 8/7/01 01:00:00. Now let's say three days later
the content changes so the datetime on the content is 8/10/01 01:00:00. The
next time the page is requested it will check to see if the page cache was
created after the last time the content was created. Now it isn't so it
would refresh 8/7/01 04:00:00 < 8/10/01 01:00:00


That is a reason.

Ben Elmore
Spectra Product Evangelist


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to