You have to either choose dir-monitoring and file-change-notification with its drawback of using SMB resources or periodic file attribute check with its drawback of serving stale content for a period of time.
If you can write a native module, you can use IHttpServer::NotifyFileChange to notify the file-cache of the file changing when you manually change it.
http://blogs.iis.net/ksingla/archive/2007/12/30/list-of-registry-keys-affecting-iis7-behavior.aspx
来源:https://www.cnblogs.com/baozhu/p/7991955.html