VirtualPathProvider and Caching
-
We have a ASP.Net 1.1 application we are moving to ASP.Net 2.0. The resources for this application are embedded, and served up using a virutal HTTP module. For example, an image on a page would have a url of getimage.aspx?smiley.gif , and the actual smiley.gif image is embedded in a .dll as a resource. The module extracts and serves up the image when it is called. In ASP.Net 2.0 I have implemented a VirtualPathProvider to do the same thing, and it appears to work but with 1 caveat: The first call to the resource is cached and that value is always used. So if I make a call to getimage.aspx?smiley.gif I get the correct image, but if I make the call again to (say) getimage.aspx?frowny.gif I get the smiley.gif image. I have debugged this to the point I know that the 2nd call isn't coming through, and figure it is caching my virtual url after the first call. How can I stop this? I want it to never cache the getimage.aspx page (or at least to detect the parameters are different, which I would have thought it should be doing anyway) Note: I have overridden GetCacheDependency to return Null, and it didn't change anything. I also tried overriding GetCacheKey, providing it unique keys for each call, to no avail. Any help/insight on this?
Michael Developer, Author, Chef