Special RSL Library Caching Problem for Flex

I am a bit confused about how to avoid RSL caching on the client machine. I have many modules and one main application that loads them. Almost every module and application itself uses the RSL library (which is my common library project).

Here's what it looks like:

  • MyLib.swf ( RSL )
  • MainApp.swf (uses MyLib.swf as RSL )
  • modules / Module1.swf (uses MyLib.swf as RSL )
  • modules / Module2.swf (uses MyLib.swf as RSL )
  • modules 3.swf

The problem itself:

Now I am changing the code in MyLib and compiling a new version of MyLib.swf. How can I be sure that users who have already downloaded the old version of MyLib.swf will receive the new RSL , and not the old, cached?

Is it possible to do this using RSL :

var loader: Loader = new Loader(); loader.load(new URLRequest("MyLib.swf?v1.2.3"); 

PS - it changes every time the name MyLib.swf to something like MyLib-v1.2.3.swf is not a solution, because I have something like 20 modules and compile them every time I change something minor in MyLib is not a good solution.

+4
source share
1 answer

You may not need RSL. What is your ApplicationDomain hierarchy? If you do not explicitly specify a boot context when loading modules, you get each module in a new child ApplicationDomain

If this is true, and you do not plan to use the old modules with a new application, etc., you can radically optimize all this by following these steps:

  • Compile all the classes that you used to place MyLib.swf in MainApp.swf (quick and easy) OR load MyLib.swf in ApplicationDomain.currentDomain before loading the first module

  • Exclude all lib classes from moduleX.swf (maybe you already do this)

PS: About Flex RSL.

0
source

All Articles