IE在ssl下CacheControl问题

By | January 21, 2010

今天碰到一个问题,IE在ssl(https)环境下,下载文件,会出现如下错误信息:

“Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.”

查了一下KB (http://support.microsoft.com/default.aspx?scid=KB;EN-US;q316431&),原来是IE的一个bug,在2007年的时候已经有了,但微软到现在还没修复,唉~

原因大致是这样的:

在ssl下,ie强制no-cache,如果no-cache已经在header里存在了,那么ie就不缓存文件了,所以文件找不到。(好莫名的说法啊)

尝试在下载页面里设置Response.CacheControl, 没有效果。最后,索性调用Response.ClearHeaders();,把Header全部清空,然后再设置Content-Type等属性,问题解决。