简体   繁体   中英

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

In my Play (2.3, scala) application i would like to use two different caches for different use cases. Eg 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM