Last post Jul 13, 2010 03:44 AM by vletroye
Jun 24, 2010 01:18 PM|rockstar1971|LINK
I’ve built a custom httphandler frontend for a website application. It handles all (“*”) requests to the virtual root. This allows full control over the urls via our custom CMS application. I didn’t build the handler to support basic static files such as
images, etc, as we want IIS to still serve these out. The only way I’ve been able to accomplish this is to configure the handlers in the web.config, like the below sample. This hands off static files to the StaticFileHandler first and then our handler takes
all the rest of the request. This works very well, except one big issue, which seems like maybe a bug in the StaticFileHandler. Every once in awhile, the static files don’t get served out (or at least the browser can’t get to them). Our images and css are
all broken. The only fix is to do an iisreset.
Comparing the response headers of native IIS vs. the StaticFileHandler, I see one difference. Files served by the StaticFileHandler have an “Expires” with a date that appears to be set 24 hours from the current date…the headers from IIS do not have this
name/value at all. I’m wondering if this is messing with how browsers cache files and causing this issue….?
Has anyone else experience this issue? Any thoughts on another way to serve out these static files without using the StaticFileHandler. This is .NET 3.5 running on IIS 7.5. Thanks!
Jun 29, 2010 12:38 PM|rockstar1971|LINK
no love? :(
Jul 13, 2010 03:44 AM|vletroye|LINK
We have experienced an issue with staticFileHandler in the global web.config when this handler was the first one in the httpHandler section.
In such a situation, the staticFileHandler was ignored by asp.Net
The solution was to add a dummy staticFileHandler immediately after the <clear /> element (or move my staticFileHandler at the end of the httpHandler section). This issue was submitted to Microsoft which confirmed the bug. As workarounds exist, Microsoft
told us they would not fix it except if we submit a strong "business case" through our "support premier".
Maybe you experience the same issue ?