The discussion on vm-dev shows that this tries to solve a problem which rather is at image side in latest Pharo. See http://lists.squeakfoundation.org/pipermail/vm-dev/2018-March/027341.html and that we should aim at simplifying the implementation rather than complexifying See http://lists.squeakfoundation.org/pipermail/vm-dev/2018-March/027343.html
About the simplification, wasn't there another effort to remove the cached file size? And excuse the naive question, but why feof() would not work for all cases?