CacheDependency dep = new CacheDependency(Server.MapPath("~/file.txt")); Cache.Insert("file", "cached file content", dep);In this example, a CacheDependency is created with a file path "~/file.txt". The file is then cached with a key "file" and the CacheDependency is associated with it. If the file "~/file.txt" is changed or deleted, the cached object will be invalidated. Package library: System.Web.Caching (part of .NET Framework)