Please improve the Play cache API documentation!


I think the Play cache API documentatio needs to be improved in order to explain which exact configuration the Play Framework uses for each cache implementation, like Ehcache and/or Caffeine.

At this time, important properties of the cache, such as the maximum number of items in the cache, can only be figured out by experiment (or maybe by studying the Play source code). Even worse: My test shows that when using the Ehcache cache in Play Framework, then the number of elements appears to be limited to 10000, whereas when using Caffeine cache in Play Framework, then there appears to be no limit at all! Because Caffeine apparently does not have a size limit (by default), a Play application using Caffeine cache will sooner or later run out of memory and cause the JVM to crash :scream:

Also, it needs to be documented which options are available for each cache implementation and how exactly we can change them in the play configuration. Looking at the “official” Ehcache or Caffeine documentation doesn’t help, because their documentation expects that you explicitely create the cache using a Builder. In Play Framework, however, the cache is created implicitely by the framework :thinking:

Thank you and best regards.