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
|