-
Notifications
You must be signed in to change notification settings - Fork 66
Description
When using the current NuGet pacakge and implementing ICacheability on a handler, the response headers don't appear to reflect the CacheOptions.
public CacheOptions CacheOptions {
get {
return new CacheOptions(new TimeSpan(0, 0, 0))
{
Level = CacheLevel.None
};
}
}
// Or...
public CacheOptions CacheOptions {
get { return CacheOptions.DisableCaching; }
}Creating a simple GET request in Fiddler shows that the request:
Host: localhost:53305
Connection: keep-alive
Accept: application/json, text/plain, /
X-Requested-With: XMLHttpRequest
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Receives this response (using IISExpress/VS2012):
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 01 Oct 2013 20:23:19 GMT
Content-Length: 9
While I am using NoCache (and IISExpress) as the description for the bug, the same headers are returned when using something such as (or using it in IIS7.5/8):
public CacheOptions CacheOptions {
get {
return new CacheOptions(new TimeSpan(1, 0, 0))
{
Level = CacheLevel.Public
};
}
}