void Pipeline_Rewrite(System.Web.IHttpModule sender, System.Web.HttpContext context, IUrlEventArgs e) { var os = provider.GetOverlays(e.VirtualPath, e.QueryString); if (os == null) { return; } long hash = 0xab224895; int offset = 0; foreach (Overlay o in os) { int ohash = o.GetDataHashCode(); string physicalPath = HostingEnvironment.MapPath(o.OverlayPath); try{ ohash ^= (int)(File.GetLastWriteTimeUtc(physicalPath).Ticks / (TimeSpan.TicksPerMillisecond * 5)); }catch {} hash ^= ohash << (offset % 50); offset += 31; } //Store a hash of all the overlays, so the disk cache updates when an overlay changes e.QueryString["customoverlay.hash"] = hash.ToString(); //And save the overlays for later RequestOverlays = os; }