Dec 10, 2008

IE cache problem

IE不知道是太白痴還是太聰明
竟然會對ajax的網頁也做Cache
結果造成可能不會refresh頁面

不過還是有解法

有人說加
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.Expires = -1;

有人說加
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

有人說加
Cache-control: no-cache\r\n
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

所以都加一加....
(以上php/asp 自己對應修改)

No comments:

Post a Comment