Comments on: Make your browser cache the output of an HttpHandler https://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-an-httphandler/ Because I like to share knowledge Tue, 03 Jan 2017 18:44:20 +0000 hourly 1 https://wordpress.org/?v=5.2.2 By: Max https://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-an-httphandler/#comment-113 Wed, 06 Mar 2013 09:41:16 +0000 http://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-a-httphandler/#comment-113 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 https://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-an-httphandler/#comment-112 Wed, 11 Jul 2012 07:36:59 +0000 http://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-a-httphandler/#comment-112 Sorry, should be >= in the previous comment...

]]>
By: Stefan Emanuelsson https://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-an-httphandler/#comment-111 Wed, 11 Jul 2012 07:30:08 +0000 http://blog.hompus.nl/2011/03/11/make-your-browser-cache-the-output-of-a-httphandler/#comment-111 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" 🙂 )

]]>