我们有一个使用URL路由的Webforms项目。我已经定义了图片和CSS文件的异常路由,如下:
routes.Add("IgnoreImages", new Route("img/{*pathInfo}", new StopRoutingHandler()));
routes.Add("IgnoreCss", new Route("css/{*pathInfo}", new StopRoutingHandler()));
静态文件应该直接由IIS提供服务,并绕过路由。
在使用Fiddler检查图像的响应时,缓存标题下唯一的键是日期。缺少的是Cache-control:max-age键。如何为静态文件指定缓存策略?此应用程序在IIS7.5上运行。