Tom Krcha's FlashRealtime

Hey amigo!
I am Tom Krcha, Gaming Evangelist at Adobe. These are my notes


Is your Flex app big in KB? Use Runtime Shared Libraries

December 8th, 2008

Using RSLs is one of the most recommended methods for reducing file size and I highly encourage you to do this. Simply - more people use RSLs in their projects, better for everybody and I am going to tell you why.

When you compile you Flex app, the whole SDK and other SWC libraries are added to your SWF, that means if you write only one line of ActionScript code in Flex you compiled app will have definitely more than 100 KB in size and this is really not cool.

RSL technique separate libraries you use from your code and place them next to your app. Then when your app is loaded, it looks for dependency libraries (RSLs), load them and cache them - so this is the answer for why more people should use it, because it may simply happen - that user loading your Flex app already has the library and doesn’t have to load it again.

There are signed and unsigned libraries. Signed are those cached by a Flash Player, which is great, while it’s independent on browser cache and system. Unsigned are simply cached by browser, which is same cool, but it may happen that you empty your cache and lose all cached libraries. Adobe is responsible for signing libraries and it’s all Flex SDKs and later others.

To enable RSLs in Flex is very easy, just change your Flex Build Path Framework linkage from Merged into code to Runtime shared library:

 

RSL setup in Flex

RSL setup in Flex

 

 

Serge Jespers has recorded great video: 3 Ways to Make Your Flex Applications Smaller:
1. use modules
2. use release output instead of debug
3. use RSLs

It’s 5 minute video… really recommend you to watch it!

Useful links:
- RSL at Adobe Labs
- Using Runtime Shared Libraries at Adobe Developer Center