Thomas,
Thanks for the quick reply. Some comments inline below...
On 9/25/2013 3:31 AM, Thomas Vandahl wrote:
The latest commits were just four weeks ago. Currently, I'm
maintaining this alone. All contributions would be welcomed.
I'll build from source and see if there's anything I can contribute
along the way. One of the discrepancies I noticed was the packages in
the wiki mentioned as org.apache.commons.jcs while in the jar I
downloaded from the Downloads page (v1.3) the packages are org.apache.jcs.
I'm liking JCS more than ehcache. I used to use oscache but that's dead.
If there's anything specifically that can be done to get a more recent
release out please let me know.
Ideally I'd like to write cache to disk immediately in case the servlet
crashes without being able to call dispose(). Should I set MaxObjects to
0 in the region definition of cache.ccf?
See the documentation of the purgatory at
http://commons.apache.org/proper/commons-jcs/IndexedDiskAuxCache.html.
If you set the size of the purgatory to 0 your performance will suffer
seriously. Mind you, JCS is a cache, no data store.
I need to cache some data that takes a bit longer than I'd like to
retrieve but does not update frequently and I do not need to store it
indefinitely. Pulling it from a local drive is a lot faster than pulling
it in normally.
I wound up digging through the code and found the DiskUsagePatternName
property and set it to UPDATE in cache.ccs. I keep MaxObjects and
MaxPergatorySize at >0 values but the objects get written to disk fairly
quickly. Within a second or so of putting them in cache. This seems to
accomplish what I need. It is a region property, not disk property and I
eventually found the documentation for it at
http://commons.apache.org/proper/commons-jcs/RegionProperties.html
From what I understand and what I'm seeing, now when I write to cache
it goes into memory, then it goes to purgatory (also memory) and then to
disk. Everything appears to still be done asynchronously but the disk
write is done fast enough for my needs.
I'd like the objects in disk cache to expire after 7 days. Which
configuration parameter(s) do I need to change?
Expiry is handled by the memory cache. Empty spots in the disk cache
will be reused. If you want to clean up every now and then, you may want
to play with the configuration options OptimizeAtRemoveCount and
MaxReycleBinSize.
If I understand correctly, setting MaxLifeSeconds to 7 days (in seconds)
will accomplish what I want. Whether the cache object comes from disk or
memory JCS will check if the object has expired and return null if it has.
There doesn't seem to be a a DiskShrinker like there is a memory
shrinker so it looks like the objects stored on disk will only be
removed passively when retrieved and identified as expired? I'll look
into the Recycle bin more.
HTH.
Bye, Thomas.
Helps a lot thanks. I think I got it working where I need to last night
but the additional info will help me tune it better.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]