Sometimes you just need a quick and simple caching implementation without all the fuss and muss of jar files, configuration, etc. Here is a free and simple solution for those that are interested.
http://simple-software.ca/lru.jsp
-
Simple LRU caching with expiration (6 messages)
- Posted by: Ian Schumacher
- Posted on: October 30 2005 14:22 EST
Threaded Messages (6)
- do they cache their site? by n a on November 03 2005 11:01 EST
- EHCache,OSCache,etc by Jeryl Cook on November 23 2005 11:02 EST
- EHCache,OSCache,etc by Ian Schumacher on November 23 2005 17:28 EST
-
EHCache,OSCache,etc by Jeryl Cook on December 28 2005 12:21 EST
- EHCache,OSCache,etc by Ian Schumacher on January 02 2006 08:21 EST
-
EHCache,OSCache,etc by Jeryl Cook on December 28 2005 12:21 EST
- EHCache,OSCache,etc by Ian Schumacher on November 23 2005 17:28 EST
- JCS by Aaron Smuts on February 17 2006 19:56 EST
-
do they cache their site?[ Go to top ]
- Posted by: n a
- Posted on: November 03 2005 11:01 EST
- in response to Ian Schumacher
The site doesn't answer.
Does it use cache? -
EHCache,OSCache,etc[ Go to top ]
- Posted by: Jeryl Cook
- Posted on: November 23 2005 11:02 EST
- in response to Ian Schumacher
EHCache requests a few .jars but a also a few lines of code, and a optional config file..
'component' based programming is always best, you design the system right the first time.
don't cut corners. -
EHCache,OSCache,etc[ Go to top ]
- Posted by: Ian Schumacher
- Posted on: November 23 2005 17:28 EST
- in response to Jeryl Cook
EHCache requests a few .jars but a also a few lines of code, and a optional config file.. 'component' based programming is always best, you design the system right the first time.don't cut corners.
I took a look at EHCache. Couple of things:
Their map interface seems to take an 'Element', which requires a serializable key and value. So one has to make sure that their objects are serializable -- minor, whatever, just pointing it out. Sometimes one is not in control of all of the objects.
It is mentioned in their documentation about an expiry time, but looking through the JavaDoc, I did not see any place where I could specify an expiry time on a cached object... Probably I just missed it somewhere?? Setting a variable expiration time (different expiration for different objects) happens to be important for my code.
Cheers,
Ian -
EHCache,OSCache,etc[ Go to top ]
- Posted by: Jeryl Cook
- Posted on: December 28 2005 12:21 EST
- in response to Ian Schumacher
EHCache requests a few .jars but a also a few lines of code, and a optional config file.. 'component' based programming is always best, you design the system right the first time.don't cut corners.
I took a look at EHCache. Couple of things:Their map interface seems to take an 'Element', which requires a serializable key and value. So one has to make sure that their objects are serializable -- minor, whatever, just pointing it out. Sometimes one is not in control of all of the objects.It is mentioned in their documentation about an expiry time, but looking through the JavaDoc, I did not see any place where I could specify an expiry time on a cached object... Probably I just missed it somewhere?? Setting a variable expiration time (different expiration for different objects) happens to be important for my code.Cheers,Ian
timeToIdleSeconds - Sets the time to idle for an element before it expires.
i.e. The maximum amount of time between accesses before an element expires
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that an Element can idle for infinity.
The default value is 0.
timeToLiveSeconds - Sets the time to live for an element before it expires.
i.e. The maximum time between creation time and when an element expires.
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that and Element can live for infinity.
The default value is 0.
instead of expiry time, they use timeToLive.
which is set in the ehcache.xml, which must be on your classpath.
<cache name="com.vanitysoft.MyObject"
maxElementsInMemory="10000"
eternal="true"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
diskPersistent="false"
overflowToDisk="true"
/>
:)
a note, i switched from EHCache to OSCache because OSCache supports clustering..
Jeryl Cook -
EHCache,OSCache,etc[ Go to top ]
- Posted by: Ian Schumacher
- Posted on: January 02 2006 20:21 EST
- in response to Jeryl Cook
This still does not look like a per object expiration time to me (different times for different objects). -
JCS[ Go to top ]
- Posted by: Aaron Smuts
- Posted on: February 17 2006 19:56 EST
- in response to Ian Schumacher
The latest, mature version of JCS is far better than EHCache. Not only is it faster, it has more features and a much better disk cache.
http://jakarta.apache.org/jcs/getting_started/intro.html
http://jakarta.apache.org/jcs/JCSvsEHCache.html