修复Flash的积极的缓存 [英] Fixing Flash's aggressive caching
问题描述
我有一个加载改变的偶尔数据的一大块Flash应用程序,所以我建立了我的服务器发送的Last-Modified
头和回复一个 304未修改
当客户端的版本是不是已经过时了。
I have a flash application that loads a big chunk of data that changes occasionally, so I set up my server to send Last-Modified
headers and reply with a 304 Not Modified
when the client's version is not outdated.
它工作正常,在每个浏览器,但Flash完全忽略了这一点,缓存资源积极。它甚至没有发出一个请求到服务器,当您试图 URLLoader.load
A previously访问过的URL,它只是检索从磁盘缓存文件。
It works fine in every browser, but Flash completely ignores that and caches the resource aggressively. It doesn't even send a request to the server, it just retrieves the cached file from disk when you try to URLLoader.load
a previously visited URL.
是我觉得在谷歌的解决方法不是对我有帮助的 - 要么你永远缓存或每次(修改URL参数)重新下载该资源。我需要它们的混合物 - 重新下载当资源被更新,使用高速缓存否则
The workarounds I find on google aren't helpful for me - either you cache forever or redownload the resource every time (changing the URL parameters). I need a mixture of these - redownload when the resource is updated, use cache otherwise.
推荐答案
您可以使用一个版本号作为URL参数...这样就不会被重新下载,每次Flash播放器的负载,只有当你真正的变化版本号
You could use a version number as URL parameter... This way it won't be re-downloaded each time Flash Player loads, only when you actually change the version number
这篇关于修复Flash的积极的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!