views:

19

answers:

0

I've got the below code to make sure a service call to an ASP.NET 2.0 HttpHandler is not getting cached:

context.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
context.Response.Cache.SetValidUntilExpires(false);
context.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.Cache.SetNoStore();

on our dev machines (sadly XP so IIS 5.1) the headers I get back are exactly what I want

Server: Microsoft-IIS/5.1
Date: Fri, 27 Aug 2010 15:17:40 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: -1
Content-Type: application/xml; charset=utf-8

But when I take the same code and run it in production (IIS 6.0 and over SSL) the headers are not coming across correctly at all.

Date Fri, 27 Aug 2010 14:59:02 GMT
Server Microsoft-IIS/6.0
mn 1c
X-Powered-By ASP.NET
X-AspNet-Version 2.0.50727
Transfer-Encoding chunked
Cache-Control private
Content-Type application/xml; charset=utf-8

Anyone have any ideas why this fairly straight forward chunk of code would work in IIS 5.1 but not 6.0 over SSL?

Thanks in advance. Josh