コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: Cache.cs プロジェクト: Boychenko/CacheKiller
 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);
 }