Saturday, October 25, 2014

Windows WebDAV client : Cache timeout settings

Normally this may not cause any issues, but files are a special case because SharePoint exposes its files with the WebDAV protocol.

Since I rarely use Mac systems, I'm not sure if or how their WebDAV integration works, but Windows provides a service called the Web Client (avaialble on any client OS, and on server OS's when the 'desktop experience' feature is enabled). And for performance sake, the Web Client will perform caching... not much... by default the cache timeout is 60 seconds (on Windows 7)... but when the code is going to modify the files' contents IMMEDIATELY, even that 60 second window is sometimes noticed.

Thankfully, the timeout can be changed rather easily with a quick registry change.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MRxDAV\Parameters\FileNotFoundCacheLifeTimeInSec