Distributing changes to an existing SWF application theory
Lets say we have an online application written in AS3 and served from a server as a SWF. The first version to go out is V1.0.
Several users, some behind a proxy server, use the V1.0 application and now there is a cached copy on the client machines and the proxy server.
V1.1 is released and placed on the server. All users should see V1.1, but results will vary, some will be served the fresh copy, some will for a period receive their cache's copy, and finally some will be served the cache'd copy in the proxy server.
I can be code in the V1.0 that checks a server variable to see if it's out of date. BUT if it is out of date, is there a way in AS3 to force i开发者_Go百科t download a fresh copy, or apply the differences into itself?
Considering that I don't have access to the proxy server and can't manually or automatically clear the cache.
Is the SWF the only thing getting cached? If so then you could use a cachebuster when the page gets loaded.
Refer to your SWF like so: main.swf?timestamp=7062956829 this will cause the proxy server to think its a different file and not serve up the cached resource.
You may have a wrapper-preloader which requests the latest version number from the server each time the application starts, and then loads the application swf of the latest version.
There are also wise solutions for updates distribution like http://treetide.com/swfcontrol/
I think citizen conn provides a simple solution, albeit it introduces unnecessary server load.
You could use citizen conn's approach but instead of a timestamp, just use the app's version tag.
main.swf?app_version=1.1
A different approach would be to force the refresh from the app itself using DigitalD's approach.
But, since you are using this in the container html page, the container might be cached as well, so you need to force the reload of the container...
精彩评论