The siphon will now stop writing to its internal buffer once the size of the buffer
exceeds the maximum cache size. Because we write until we exceed the max cache size,
we're safe to attempt the cache update even if the buffer only contains partial data,
because it's still over the limit & will be rejected.
Would it be smarter to check both d.CacheSizeMax and fi.Size in readWithRLock, and only create and use the siphon if the file size could conceivably fit in the cache?
The siphon will now stop writing to its internal buffer once the size of the buffer exceeds the maximum cache size. Because we write until we exceed the max cache size, we're safe to attempt the cache update even if the buffer only contains partial data, because it's still over the limit & will be rejected.