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

前端 未结 2 632
猫巷女王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:27

    I found the solution myself on the internet.

    Really thanks jbeall replied on 07-15-2008, 11:05 AM.

    http://forums.asp.net/t/1289756.aspx

    In short words, overrides the following methods

    1. GetCacheDependency - always return null
    2. GetFileHash - always return different value

    After these modifications, for every request, MVC gets the file from source directly.

提交回复
热议问题