Is there an existing solution for WebRequest caching in .NET (based on If-Modified-Since)?

217 Views Asked by At

I have an expensive WebRequest that I know can be cached.

Is there an existing solution that allows caching of web requests based on Last-Modified/If-Modified-Since and (optionally) ETags?

2

There are 2 best solutions below

0
On

I've just written up an ActionFilter for asp.net MVC which does this http://antix.co.uk/A-Developers-Blog/IfModifiedAttribute

btw ETags are required for some browsers to send the if-modified-since header (IE notably)

0
On

I have a preliminary implementation at http://code.google.com/p/ashmind/source/browse/#svn/trunk/AshMind.Framework/Net/Caching , though it is rather lacking in tests (and some functionality).

I am going to update this answer when I have a reliably binary, but any contributions are already welcome.