One of the cache attributes is DiskUsagePatternName. The value can be SWAP or UPDATE. The default is SWAP. UPDATE immediately writes cache data to disk.
In cache.ccf add the line for
jcs.region.[yourregionid].cacheattributes.DiskUsagePatternName=UPDATE
Thus, it will write to disk without having to turn off the cache, and you can still get the benefits of the memory cache.
The disk cache writes only data when the cache object is located. In a web application, I had to explicitly call the dispose () method in the destroy () method of my servlet. If you do not call dispose () and you do not have a disk usage pattern set in UPDATE, it will not write to disk.
source share