List Info

Thread: HttpHandler caching weirdness




HttpHandler caching weirdness
user name
2006-06-07 02:30:19
I am having problems getting a handler to properly cache,
even though
this should be easy. Here's my entire handler:

public class Handler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType =
"text/plain";
       
context.Response.Cache.SetCacheability(HttpCacheability.Publ
ic);
        context.Response.Cache.SetETag("12345");
       
context.Response.Cache.SetLastModified(DateTime.Now);
        context.Response.Write("Hello World");
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}



I would expect a public cache to show up in the Http
response. But it's
not there. This is the response I get:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/8.0.0.0
Date: Wed, 07 Jun 2006 02:27:11 GMT
X-AspNet-Version: 2.0.50727
Cache-Control: private
Last-Modified: Wed, 07 Jun 2006 02:27:11 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 11
Connection: Close

Hello World




What's up with this? No Etag, and the wrong cache setting.
Any ideas?

Thanks,

Brian

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

HttpHandler caching weirdness
user name
2006-06-07 06:35:12
Well, the first thing that makes me wonder... is it because
it's the
development web server and not IIS?

On 6/6/06, Brian Vallelunga <brianvallelunga.com> wrote:
>
> I am having problems getting a handler to properly
cache, even though
> this should be easy. Here's my entire handler:


[...]

Server: ASP.NET Development Server/8.0.0.0
>

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )