Menu

#10 Modification times

open
nobody
None
5
2001-06-13
2001-06-13
No

Hello:

I was looking through the Cache::Cache source and I noticed that
while the access time for various ($identifier, $data) pairs put
into the store are manipulable behind the scenes, I don't see any
means of knowing when the $data component got written, and neither
the access or the modification time isn't explicity available in
the interface, which would let me do something like:

if ($time_last_gotten < $myCache->modified($foo)) {
$bar = myCache->get($foo);
$time_last_gotten = now;
}

which is like letting me know when the copy of the $data I have
on hand has been expired, rather than the copy in the cache being
expired, which would be really handy when I'm distributing super
extra-hefty size data structures to mod_perl child processes and
I don't want to reload the data structures with each request and
I'll trade more memory for more speed almost any day of the week
(hey, RAM is dirt cheap these days, which isn't odd considering
that is made from dirt :)

>From what I've seen so far, it appears the starting point for
this is Cache::CacheUtils. For Cache::FileCache, I'd just want
to access the modification time on the file itself storing the
$data, but but what about the memory-based classes? Or is there
an entirely different, more elegant approach?

Thanks,

--Christopher

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.