One thing that I have found when working in VS2005, is that I can be testing my VirtualPathProviders, and they will all work correctly for unmapped extensions. That is images (jpg, gif), styles sheets (css) and script files (js). Then when I move the application to run in IIS 6.0 the behaviour is different. This is because it seems that IIS does not even dispatch requests for such files to the ASP.NET runtime. So my VirtualPathProviders are not even used. Its strange how the two servers run differently.
The solution for IIS, to this problem is within one of Mark DÂUrso's presentations, http://blogs.msdn.com/mdurso/ [VSLive]. It involves adding a Wildcard Application Map in IIS's snapin (application configuration->mappings). With this mapping in place though, the ability to have default documents in a folder is lost. When normally requesting an aspx page, the ISAPI extension takes control from IIS. When you request a file that does not have an ISAPI mapping, IIS just servers the file itself. With the wildcard, all files are palmed off to the ASP.NET application extension. Don't know how this affects load/caching, having all files go though ASP.NET.
Heres what msdn says about wildcard application mappings in IIS 6.0:
Some info on httphandlers when wildcard application mappings are used:
Static mappings for content served by ASP.NET compared to IIS