Flex custom RSL library caching issue

376 Views Asked by At

I'm a little bit confused about how to avoid RSL caching on client's machine. I have many modules and one main application which loads them. Almost each module and the application itself are using the RSL library (which is my common library project).

Here is how 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/Module3.swf

The issue itself:

Now i'm changing the code in MyLib and compiling the new version of MyLib.swf. How can I be sure that the users who had already loaded the old version of MyLib.swf, will get the new RSL, and not the old, cached one?

Is it possible to do similar to this with RSL:

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

P.S. - changing every time the name of MyLib.swf to something like MyLib-v1.2.3.swf is not a solution, because I've something like 20 modules and compiling all of them every time I'm changing something minor in the MyLib is not a good solution.

1

There are 1 best solutions below

0
Maxim Kachurovskiy On

You may not need RSL at all. What is your ApplicationDomain hierarchy? If you don't explicitly specify loading context while loading your modules, you end up with each module in a new child ApplicationDomain

If that's true and you don't plan to use old modules with new app and things like that, you can radically optimize this whole thing by doing the following:

  1. Compile all classes that you used to put it MyLib.swf into MainApp.swf (fast and easy) OR load MyLib.swf into ApplicationDomain.currentDomain before you load the first module

  2. Exclude all that lib classes from moduleX.swf (you may already be doing that)

P.S.: About Flex RSLs.