使用 cmd 命令清除我的缓存=> ipconfig/dnsflush?

发布于 2024-07-19 02:24:09 字数 222 浏览 5 评论 0原文

如果我的计算机是多个实时网站的 Web 服务器,如果我在命令提示符编辑器中键入 ipconfig/dnsflush 会有什么危害吗?

我总是遇到这个问题。 我在 .html 文件中嵌入了 Flash (swf)。 每当我更新 swf 时,.html 文件总是使用旧的 swf,即使我清除了缓存和其他内容。

有什么方法可以让我的 .html 文件始终获取最新/更新的 swf 文件吗?

If my computer is the web server for multiple live websites, is there any harm if I type ipconfig/dnsflush in my command prompt editor?

I always got this problem. I embed a flash (swf) in a .html file. Whenever I update the swf, the .html file always use the old swf even if I clear my cache and whatever else.

Is there any ways to have my .html file always get the latest/updated swf file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑饮青盏花 2024-07-26 02:24:09

输入 ipconfig/dnsflush 不会解决您的问题,那就是刷新 DNS 缓存,您的问题是浏览器正在缓存您的 SWF 文件。 有几种方法可以阻止这种情况。 最简单的方法可能是在 EMBED/OBJECT 标记中的 SWF 文件的 URL 上添加随机查询字符串:

<script type="text/javascript">
<!--
document.write('<object etc ... ');
document.write('<param name="movie" value="filename.swf?r=' + Math.round(Math.random() * 99999) + '">');
document.write(' the other param tags here );
document.write('<embed src="filename.swf?r=' + Math.round(Math.random() * 99999) + '" etc .... </embed>');
document.write('</object>');
//-->
</script> 

但请注意,这意味着每次都会重新下载您的 SWF,而不是从浏览器缓存中下载。 如果您不希望这样做,请考虑在查询字符串中添加版本号而不是随机数,并在您希望客户端下载新的 SWF 文件时增加此值。

Typing ipconfig/dnsflush won't fix your problem, thats flushing the DNS cache, your problem is that your SWF file is being cached by the browser. There are a few ways to stop this. The easiest is probably by adding a random query-string onto the URL of the SWF file in the EMBED/OBJECT tag:

<script type="text/javascript">
<!--
document.write('<object etc ... ');
document.write('<param name="movie" value="filename.swf?r=' + Math.round(Math.random() * 99999) + '">');
document.write(' the other param tags here );
document.write('<embed src="filename.swf?r=' + Math.round(Math.random() * 99999) + '" etc .... </embed>');
document.write('</object>');
//-->
</script> 

But be aware that this means your SWF will be downloaded afresh every time, and never from the browser cache. If you don't want this, consider adding a version number in the querystring rather than a random number, and increment this when you want clients to download a new SWF file.

凤舞天涯 2024-07-26 02:24:09

我有一个小的 php 片段,用于在 flash' url 的末尾附加我将文件上传到服务器时的 unixtime。 这样我只需上传新的,一切都会自动解决。

I have a little php snippet that I use to append the unixtime of when i uploaded the file to the server at the end of the flash' url. This way I just upload the new one and everything sorts itself out automagically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文