ASP.NET MVC 2 VirtualPathProvider GetFile every time for every request

前端 未结 2 637
猫巷女王i
猫巷女王i 2021-02-09 01:30

I have implemented a VirtualPathProvider. The VirtualPathProvider reads the view from File system.

However my problem is the method GetFile(string virtualPath)

2条回答
  •  忘掉有多难
    2021-02-09 02:20

    public class MyVirtualPathProvider : VirtualPathProvider
    {
    
        public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            return null;
    
        }
    
        public override String GetFileHash(String virtualPath, IEnumerable virtualPathDependencies)
        {
            return Guid.NewGuid().ToString();
    
        }
    }
    

提交回复
热议问题