4

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.

Community
  • 1
  • 1
Yevdo Abramov
  • 609
  • 4
  • 10
  • 1
    Interesting question. I guess you might be able to pass the version number in the RSL's url whereever you configure your RSL's. For instance in a config.xml file you might be able to set `MyLib.swc?v1.2.3` under the `` node. – RIAstar Feb 13 '13 at 09:03
  • Thank you for fast reply, @RIAstar. Can you please tell me more about the config.xml. I've made many tests with the issue I've mentioned and realized that there is no caching problem. Every time I was changing something in the MyLib.swf and uploading it to server, the changes were reflected. But Adobe [says](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf674ba-7fff.html#WS2db454920e96a9e51e63e3d11c0bf674ba-7ffb) that RSLs are cached, and that's the reason I can't be sure that my clients won't use the cached version. – Yevdo Abramov Feb 13 '13 at 12:57
  • 1
    RSL's _are_ cached, but I think (not sure) that whenever the main application is recompiled, the referenced RSL's are refreshed anyway. The caching only applies as long as the main app doesn't change. This would imply that you need not change anything to the configuration of your RSL's. I repeat: I am not completely certain of this. – RIAstar Feb 13 '13 at 13:12

1 Answers1

0

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.

Maxim Kachurovskiy
  • 2,992
  • 2
  • 21
  • 24