I use JCS for caching. Now I use the disk cache to temporarily store all the data. The problem is that I use JCS, the keys are written to disk only if the cache is correctly completed.
I use the disk usage pattern as UPDATE, which tells JCS to write data to the disk immediately without storing it in memory. But the problem is that we do not deal with the key list of objects in the cache. So I use the cache group to access and get the keys from the cache, and then iterate over the keys to get the results.
So, now I am in a situation where I need to completely close the cache, i.e. after all the data is written to disk using the indexed disk cache. But there is a difficulty here, the background stream is used in the indexed disk cache to write to the disk, which returns nothing by its status.
So now I canβt guarantee that the cache with indexed disk writes data to disk for my front-end implementation. Is there a way to solve this situation, because now I just sleep for some random time (say, 10 seconds) before the cache shuts down, which is a very stupid way to actually do it.
Edit: I ran into this problem with the memory cache, but sleeping for one second is basically enough for 500 MB of data. But the disk cache case is a little different.
source share