Using two cache providers in Play Framework at the same time?

119 views Asked by At

In my Play (2.3, scala) application i would like to use two different caches for different use cases. E.g. redis cache for one UC, memcached for another. Is there a way to configure this?

Ideally make one cache provider default, and specify another when using.

Thanks for suggestions.

1

There are 1 answers

1
Archana On

Yes, it can be done.

Try using a service like Apache Zookeeper: Configure your caching settings (like server and port numbers) for each application there, also keep a boolean variable around for each one.

If the boolean is set to false for one cache, this signals to use the other caching mechanism, and the other way round if the booleans are differently set.