With Ehcache 3 if I have a persistent cache does that mean that everything will be written to the disk cache even if the heap/offheap caches are full or not ?
i.e I have this
PersistentCacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder()
.with(CacheManagerBuilder.persistence(new File(Platform.getPlatformDatabaseFolder(), RELEASE_CACHE)))
.withCache(RELEASE_CACHE,
CacheConfigurationBuilder.newCacheConfigurationBuilder(
String.class,
String.class,
ResourcePoolsBuilder.newResourcePoolsBuilder()
.heap(100, EntryUnit.ENTRIES)
.offheap(10, MemoryUnit.MB)
.disk(20, MemoryUnit.MB, true)))
.build();
So I am expirmenting with this but I have specified a disk cache because usually memory cache will not be sufficient, and I have specified it to be persistent because if data is written to the disk it may well be useful for subsequent runs of the application.
However, sometimes the application may be used in such a way that the heap/offheap is not fully used, therefore I do not want the application to be wasting time writing data to disk just because I have marked it as persistent. After all the reason I am using a cache is to improve performance.