如何避免我的swf被缓存?

时间:2012-05-07 23:43:28

标签: actionscript-3 caching flash

如何避免我的swf被缓存在内存中?我读到我必须使用这样的东西:

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

多数人?

2 个答案:

答案 0 :(得分:2)

我使用get param来避免缓存,比如myswf.swf?date或myswf.swf?random

我使用swfobject将swf加载到html页面。这是一个例子。

“myContent.swf?”+ Math.random()* 321 - &gt;这使得swf无法缓存。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject dynamic embed - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>

    <script type="text/javascript">
    swfobject.embedSWF("myContent.swf?"+Math.random()*321, "myContent", "300", "120", "9.0.0");
    </script>

  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
  </body>
</html>

SWFOBJECT link

答案 1 :(得分:0)

您还可以将expires标头与已经过的日期一起使用:

<!-- BEGIN INSERT --> 
<META HTTP-EQUIV="Expires" CONTENT="Mon, 04 Dec 1999 21:29:02 GMT">
<!-- END INSERT -->

但是,这就是全部!