Maxim's blog: Caching objects with Guava
Thursday, February 23, 2012 Caching objects with Guava Recently I have started using guava-library . It provides support for collections, caching, concurrency, string processing and other things . So while I am doing first steps with this project I decided to prepare a couple of posts dedicated it. As for today's post it is about caching objects. Simple example I will start right from an example, the simple one. It will be a cache with two expiration policies. One policy is for accessing objects – it determines after which time since last access an object gets expired. Another one defines when an object gets expired since last time it was written. Sounds similar. The following picture should help to figure out differences. It shows time line in hours. Expiration for last access is set to 3 hours, and for last write – 5 hours. Circles represent events when items are queried from cache. As we can see object gets expired at 4th hour due to last access interval.Read full article from Maxim's blog: Caching objects with Guava
No comments:
Post a Comment