梁某人

发展才是硬道理

导航

缓存的技巧

 Put that in the HEAD section of the HTML page
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
However, MS IE (almost all versions) do not process the instruction properly due to the cache mechanism.

The workaround is to included a second <HEAD> section at the bottom of the page (no joke!).

<HTML><HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="REFRESH" CONTENT="5">
<TITLE> Demonstration Pragma No-cache </TITLE>
</HEAD><BODY>
This page has 2 HEAD sections to properly bypass the cache in all browser.
</BODY>
<HEAD><META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"></HEAD>
</HTML>
NOTE: the above example uses META HTTP-EQUIV="REFRESH" to make the browser reload the page automatically after 5 seconds, this is for demonstration purpose only (to see that the cache is actually bypassed). This has nothing with the bypassing of the cache itself.

posted on 2007-06-27 01:19  涛仔28  阅读(268)  评论(0编辑  收藏  举报