Comments on: Make your browser cache the output of an HttpHandler Because I like to share knowledge Mon, 25 Nov 2019 23:27:38 +0000 hourly 1 By: Mat Mon, 25 Nov 2019 23:27:38 +0000 Hello,

It's possible to have the Resource class ? Because i don't understand this.


By: Max Wed, 06 Mar 2013 09:41:16 +0000 The article was a big help for me to implement Microsoft's Ajax Utilities as an ASPX module (using a filter that shrinks Javascript on detection in certain file types). Only that in FileInfo.LastWriteTime (which I used to decide on caching) I had to remove the ticks, not the milliseconds:

fileInfo.LastWriteTime.AddTicks(-fileInfo.LastWriteTime.Ticks % TimeSpan.TicksPerSecond)

By: Stefan Emanuelsson Wed, 11 Jul 2012 07:36:59 +0000 Sorry, should be >= in the previous comment...

By: Stefan Emanuelsson Wed, 11 Jul 2012 07:30:08 +0000 Thanks, helped a lot. As a slightly paranoid coder i would prefer using

if (resource.LastModifiedDate.AddMilliseconds(
-resource.LastModifiedDate.Millisecond) > ifModifiedSince)

Instead of comparing for exact the same DateTime's, although the browser should just echo back the server's last last-modified this feels a little bit less bug-prone (or should i say "future safe" 🙂 )