There's been an internal request to extend the meaning of the
"ttl-in-cache" directive for the cache.config configuration file. After
several failed attempts, this is my current approach.

The time operators '<' and '>' are added for the ttl-in-cache directive.
These mean "at most" and "at least" respectively and are used in front of
the time specifier. E.g.

... ttl-in-cache=30m # exactly 30 minutes, as it currently means.
... ttl-in-cache=>30m # at least 30 minutes in cache.
... ttl-in-cache=<30m # at most 30 minutes in cache

For "at least", if the response headers indicate a cache time longer than
the specified time, that is used, otherwise the specified time is used. The
opposite for "at most" - if the response has a shorter cache time, that is
used, otherwise the specified time. A subtle point is that "=<" may not
force an object in to cache, because a response that doesn't allow caching
is treated as if the cache time was zero, which will be less than the
specified time.

P.S. Due to the way this file is parsed, the '=' must be first.

-- 
*Beware the fisherman who's casting out his line in to a dried up riverbed.*
*Oh don't try to tell him 'cause he won't believe. Throw some bread to the
ducks instead.*
*It's easier that way. *- Genesis : Duke : VI 25-28

Reply via email to