My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GettingStarted  
How to get up and running with BigCache
Featured
Updated Sep 8, 2008 by treeder

Dependencies

  • jets3t
  • commons-logging (included in jets3t distro)
  • commons-httpclient (included in jets3t distro)
  • commons-codec (included in jets3t distro)

Details

Create the Cache

// it would be wise to do this only once and reuse it
BigCache bigcache = new S3Cache(AWS_ACCESS_KEY, AWS_SECRET_KEY, "my-caching-bucket-name");

Put an object into the cache

// the 3600 is how long the object will live for, this one will expire after 1 hour
bigcache.put("somekey", myObject, 3600);

Get an object from the cache

Object o = bigcache.get("somekey");
Comment by burtona...@gmail.com, Sep 18, 2008

Your memcached benchmarks are someone handicapped by the fact that you're not using getMulti.... get() is about 1-2ms per 100 but if you rewrite your code to call getMulti() once on all 100keys it will take about 1ms or .01ms per key.

Kevin (spinn3r.com)

Comment by project member treeder, Nov 14, 2008

Kevin: Using the async methods on BigCache? improves the performance of this quite a bit. I'll have to do some new benchmarks with your suggestion as well as with the these http://code.google.com/p/bigcache/wiki/AsyncMethods


Sign in to add a comment
Powered by Google Project Hosting