The ASP.NET Development Server (aka Cassini) included with Visual Studio 2005 (the default web server for new web projects) doesn't honour cache headers emitted using the HttpCachePolicy class.
Inspecting the response headers from a page running in Cassini reveals the Cache-Control header is set private despite instructions to make the response publically cacheable:
context.Response.Cache.SetExpires (DateTime.Now.AddSeconds (30));
context.Response.Cache.VaryByHeaders ["Accept-Language"] = true;
Just as importantly, no Vary header is sent down the line.
By contrast, running the same page in IIS sets the Cache-Control header public and the Vary header is set to Accept-Language, as intended.
The ASP.NET Development Server is a great help--when it works; when it does stuff like this it really throws a spanner in the works.
Post a Comment
Spam comments will be deleted
Note: only a member of this blog may post a comment.