RSLs in Flex


There are several ways in which we can optimize the size of an application and to ideally increase the performance but using RSL does make a substantial change in the size of the SWF file. It makes the shared assets into a standalone file that can be downloaded and cached seperately on the client side.There are different types of RSL that are supported in Flex.
Why do we use RSLs ?
We can check this by creating a new flex project in flex builder, we will have an approx of 250KB of SWF file size and when we have RSL enabled the SWF file size is reduced considerably to 99KB which gives a clear indication on scale to which a flex application can be optimized.
How you can do it?
In Adobe Flex 3 the RSL is not enabled by default and everytime you compile your application everything including the framework  gets compiled into the SWF file that comes as the output of your app.
Now enable RSLs from the Library Path in the properties of your project.

2009-07-31_200331

Now we can go into the details what all happens.
Since we are considering this simple flex application we will only go through Framework RSLs in this post.After the above settings you build your application and you will find the bin folder has 2 more extra files generated from compilation – framework_3.3.0.4852.swf and framework_3.3.0.4852.swz

bin
These are framework RSLs which is externalized from your main application SWF and this results in considerable weight loss of the main SWF file. The framework RSLs consists of the pre-compiled libraries of Flex components and class libraries. These RSLs comes in two version – Signed (framework_3.3.0.4852.swz)  and Unsigned (framework_3.3.0.4852.swf) Framework RSLs. Signed RSLs are cached in player cache whereas the unsigned ones are cached in the browser. Similarly along with flex framework  the rpc and datavisualiztion components are also included in the Framework RSLs.

Since this is huge topic to be completed in one single post, I will again elaborate on this segment in my coming posts. So stay tuned… 🙂

Advertisements

Published by

Sunil Nair

I am a Software Developer currently working on developing Rich Internet Applications using Adobe Flex/AIR. I have had diverse experience of developing application in software industry for the last 4 years.

One thought on “RSLs in Flex”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s