This project is read-only.

Http caching headers

Topics: Web Api
Apr 25, 2011 at 4:27 PM

I noticed that some caching headers in this last drop (preview 4) were moved to the HttpContent class but some others not. For example, the "Expires" header is now part of the HttpContent class, but "Cache-Control" is still part of the HttpResponseMessage class. Same thing with ETag and LastModified. Is this intentional ?. For me, all the headers for controlling caching should be in the same place.

Also, the CacheControl instance in the response is not initialized by default so you need this unnecesary line for using it,

response.Headers.CacheControl = new CacheControlHeaderValue();

<!--CRLF--> <!--CRLF-->