On Wed, 12 Sep 2001, Joshua Chamas wrote:
> I think that the invalidate parameter is the Clear I suggest,
> and that Clear could be used to effectively deal with the timestamp
> issue, but the logic must exist outside the caching mechanism.
Wouldn't it be a bit complicated to setup this logic, though? I would have
to create some persistent variable keyed by the filename and Query String
that keeps track of when the file was last recreated.
The reason that I suggested a timestamp parameter (which means "regenerate
the page if the cached copy is older than $timestamp") is that the
Response->Include function would already have all the information it needs
for this logic. It has the script filename, it has the key (e.g. query
string), and it knows the timestamp of the cached file.
I think that it would be simple to implement too, if you have the Clear
parameter already. It would just be:
if ($args{timestamp} && $timestamp_of_cached_file < $args{timestamp}) {
$args{clear} = 1;
}
Rationale:
The only reason I can think of invalidating the cache is that something
has changed. A timestamp should always be usable for determining whether
something changed before or after the cache file was calculated. If there
are multiple timestamps (e.g. the include file depends on the timestamp of
"a.asp" and "b.asp"), then they can be max()'d before being passed to
$Response->Include. That's why I think it's a good idea to have
"timestamp" be a parameter to $Response->Include; timestamp could be the
number of seconds since 1970 (i.e. a standard UNIX timestamp).
> The directive CacheSize, in bytes, already supports this. The same
> cache size will be used for the XSLT cache, Includes/Script(TODO) cache,
> and users cache(TODO). The default is 10000000, so using all three
> caches could take nearly 30M. I don't want each to be specified
> separately, there are already too many configs as it is.
Wouldn't it be more intuitive if you made it so that all three caches
added together can only take CacheSize bytes, rather than letting each
individual cache take CacheSize bytes?
The rationale for this is that when deciding what to set CacheSize to,
someone would base this on how much disk space they have available. It's
easier if they don't have to multiply by 3.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]