using System.IO; using System.Web; using System.Web.Caching; using System.Web.Hosting; /// /// Summary description for Fingerprint /// public class Fingerprint { public static string Tag(string rootRelativePath) { if (HttpRuntime.Cache[rootRelativePath] == null) { var absolute = HostingEnvironment.MapPath("~" + rootRelativePath); if (absolute == null) return HttpRuntime.Cache[rootRelativePath] as string; var date = File.GetLastWriteTime(absolute); var result = string.Format("v={0}", date.Ticks); HttpRuntime.Cache.Insert(rootRelativePath, result, new CacheDependency(absolute)); } return HttpRuntime.Cache[rootRelativePath] as string; } }