Ken Muse improves WebResourceHandler

Last Tuesday I got an email from Ken Muse, asking for the source code of the WebResourceHandler. You couldn't download it, because I was smart enough (not!) to upload the .cs file. I've since changed the file to a zip file. Anyway, Ken was the first who ran into this problem and actually contacted me on it. He has taken the source code and implemented the timestamp and substitution feature. He did a very nice job.Here's the way he got a timestamp, which I think is a pretty nifty way of doing it.

// Validate timestamp
Uri url = new Uri(resourceAssembly.EscapedCodeBase);
long time = File.GetCreationTimeUtc(url.LocalPath).Ticks;
if (time.ToString() != timeStamp)
{
  thrownew ArgumentException("Specified resource timestamp is invalid.");
}

I just checked with Anakrino to see how the ASP.NET team implemented it in Whidbey. Pretty much the same way. They have done some extra stuff with caching support, which is not included yet.

The new source code is included, so everybody can enjoy the enhancements. Kudos to Ken for adding his bits to the code. You can contact Ken and his band Moments From Impact at http://www.momentsfromimpact.com.

Comments

# John Dyer said:

Alex, Ken contacted me to see if I could add this to FreeTextBox (a free ASP.NET HTML editor).  Could you contact me regarding this?

woensdag 30 juni 2004 20:55
# Alex Thissen said:

John, sure, go right ahead. I've also sent you an email. Let me know if it didn't reach you.

donderdag 1 juli 2004 12:17
# John Mandia said:

Hi Alex,I can't seem to find the link to the zip file that you mentioned or the original post which talked about the functionality of the source code.Could you please post a link to it?Many Thanks,John

donderdag 8 juli 2004 17:03
# John Mandia said:

Please ignore the previous post as I just found the one with the link.Many ThanksJohn

donderdag 8 juli 2004 17:05