If I read a file from a UNC network share does Windows cache parts of that file?
For example: If I read the whole file byte for byte, will each read call result in a request over the network, or does Windows read larger blocks internally, and serve subsequent request from memory?
If I understand it correctly contents of the file may be cached.
To make sure that all reads will be done against the actual file and not from any system buffer or disc cache one could use the FILE_FLAG_NO_BUFFERING
in a call to CreateFile.
You can also disable caching for a shared resource using net share <sharename> /cache:none
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With