O'Reilly logo

Play Framework Cookbook by Alexander Reelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing your own cache implementation

Play already comes with an easy to scale cache solution included, namely memcached. However, you might not want to use memcached at all. It might not fit your needs, your admin may not want to install another application on a system, or anything else. Instead of not using a cache at all, this recipe shows you how to write your own implementation of a cache. This example will use Hazelcast, a pure Java distributed system as implementation.

You can find the source code of this example in the examples/chapter6/caching-implementation directory.

Getting ready

It requires a little bit of work to get to the point to start programming. We need to get Hazelcast instance up and running and setup an application for development. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required