private AssetFile GetFileForPath(string path) { var file = Cache.Get(_context, path); if(file != null) { return file; } file = new AssetFile() { Hash = GetHash(path), Path = ResolveUrl(path) }; Cache.Put(_context, path, file); return file; }
public static void Put(HttpContextBase context, string path, AssetFile assetFile) { if(context == null || context.Cache == null || String.IsNullOrEmpty(assetFile.Hash)) { return; } var dep = HostingEnvironment.VirtualPathProvider.GetCacheDependency( path, new string[] { assetFile.Path }, DateTime.UtcNow); context.Cache.Insert(path, assetFile, dep); }