The Cache API

Caching in a web application is the process of storing dynamically generated items, whether these are data objects, pages, or parts of a page, in memory at the initial time they are requested. This can later be reused if subsequent requests for the same data are made, thereby reducing response time and enhancing user experience. One can cache or store these items on the web server or other software in the request stream, such as the proxy server or browser.

Play has a minimal cache API, which uses EHCache. As stated on its website (http://ehcache.org/):

Ehcache is an open source, standards-based cache for boosting performance, offloading your database, and simplifying scalability. It's the most widely-used Java-based cache because ...

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.