如何从缓存停止FLEX? [英] how to stop FLEX from caching?

查看:262
本文介绍了如何从缓存停止FLEX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与一个Flex应用程序我没有设计自己,其实我真的不知道很多关于柔性的运作。我想禁用所有缓存,因为它造成了很多的问题,因为我们改变为新的付款方式。

i'm working with a flex app I didnt design myself, in fact i really don't know much about the workings of flex. I want to disable all caching since its causing a lot of problems since we changed to a new payment method.

我知道禁用缓存心不是理想的,但它只是需要的时刻来完成。 我发现这是一个服务器端解决方案,但我实现它似乎并没有工作。

I know the disabling cache isnt ideal, but it just needs to be done for the moment. I found a server side solution for this, but my implementation of it doesn't seem to work.

我尝试设置它的头,这里是一块$ C $下我的index.html

i tried setting it in the header, here's the piece of code for my index.html

<head>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...........

也许有人在这个问题上的经验是愿意帮忙出?

Maybe someone with experience on this matter is willing to help be out?

推荐答案

一个Flex应用程序,其实只是一个Flash文件,这与瑞士法郎扩展名的文件。就像在网页中的任何其他资产,你可以把它通过改变文件名重装简单。你能做的最好的事情,就是包含一个版本号在该文件名。

A Flex application is in fact just a Flash file, which is a file with the .swf extension. Just like any other asset in a web page, you can make it reload simply by changing the filename. The best thing you can do, is to include a build number in that filename.

假设此刻的文件名为 MyApp.swf ,您可以将其重命名为 MyApp的-2.0.swf 而只是改变了版本号,只要你发布一个新的版本。
另一种选择是通过内部版本号为网址放慢参数,像这样: MyApp.swf V = 2.0 ,但在我的经验,这是稍微不那么可靠

Suppose at the moment the file is called MyApp.swf, you could rename it to MyApp-2.0.swf and just change the build number whenever you publish a new version.
Another option would be to pass the build number as a URL paramter like so: MyApp.swf?v=2.0, but in my experience that's slightly less reliable.

另外不要忘记,服务器可能会缓存整个页面。如果是这样的话,它将继续加载旧 MyApp.swf ,就算你改了名字。如何prevent这一点,取决于服务器端语言。

Also don't forget that the server might cache the entire page. If that's the case, it would keep loading the old MyApp.swf, even if you changed the name. How to prevent this, depends on the server side language.

这篇关于如何从缓存停止FLEX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆