I have an HttpHandler (have also done this as an ASPX page) that retrieves an image stored in the db and writes it out to the response. I have added the following lines to the code to try and get the images to cache in the browser, but whenever I look at the response in Firebug, it always has a cache-control header value of "private".
Response.Cache.SetCacheability(HttpCacheability.Public)
I've tried all sorts of things, like using the Response.ClearHeaders & Response.AddHeader() to manually add the "Cache-Control" header value, but to no avail. Any ideas?
Edit:
More info: This is running in an HTTP Handler (.ashx), and I have tested it both on my local IIS 5.1, and on the hosting site which I think is IIS 6.