Attached please find a patch, that provides additional mode of operation to Block and Index Disk Caches, i.e. that instead of limiting the key count, you limit the content size. It's a proxy for limiting the file size, but it works quite good.
The patch has additional length, as I moved:
and then - created LRUMap, that implements size-based policy.
Also, in a separate file I provided update for website docs.
I did some testing, also performance, and it looks like, it doesn't introduce noticeable difference.