Sunday, July 10, 2011

How to decrease the loading time of initial downloaded .swf file ?

The major issue that i realize in adobe flex large application is the initial loading time.Sometime when .swf file size is large then Flex take a lot of time for loading at the client side and this effect the user experience.
But don’t worry Adobe give us some alternate to resolve this problem.I will give you only brief introduction is as follow
1) Modular applications
Modules are SWF files that can be loaded and unloaded by an application. They cannot be run independently of an application, but any number of applications can share the modules.
Modules let you split your application into several pieces, or modules. The main application, or shell, can dynamically load other modules that it requires, when it needs them. It does not have to load all modules when it starts, nor does it have to load any modules if the user does not interact with them. When the application no longer needs a module, it can unload the module to free up memory and resources.
Modular applications have the following benefits:
  • Smaller initial download size of the SWF file.
  • Shorter load time due to smaller SWF file size.
  • Better encapsulation of related aspects of an application. For example, a “reporting” feature can be separated into a module that you can then work on independently.
  • Modules are similar to Runtime Shared Libraries (RSLs) in that they separate code from an application into separately loaded SWF files. Modules are much more flexible than RSLs because modules can be loaded and unloaded at run time and compiled without the application.
click here to see example and more information about the Modules application
2) Runtime Shared Libraries
Another way to reduce the size of your applications’ SWF files is by externalizing shared assets into stand-alone files that can be separately downloaded and cached on the client. These shared assets can be loaded and used by any number of applications at run time, but are transferred only once to the client. These shared files are known as Runtime Shared Libraries or RSLs.
When multiple applications share a core set of components or classes, clients can download those assets only once as an RSL rather than once for each application. The RSLs are persisted on the client disk so that they do not need to be transferred across the network a second time. The resulting file size for the applications can be reduced. The benefits increase as the number of applications that use the RSL increases.
Applications built with Flex support the following types of RSLs:
  • Framework RSLs — Libraries of components and framework classes that all applications can share. Framework RSLs are precompiled for you. Adobe provides hosted, signed framework RSLs that you can link to from any application that has internet access. For more information, see Using the framework RSLs.
  • Standard RSLs — A library of custom classes created by you to use across applications that are in the same domain. Standard RSLs are stored in the browser’s cache. For more information, see About standard RSLs.
  • Cross-domain RSLs — A library of custom classes, like standard RSLs, with the difference being that they can be loaded by applications in different domains and sub-domains. Cross-domain RSLs are stored in the browser’s cache. For more information, see About cross-domain RSLs.
You can create your own RSLs from custom libraries. You do this by using either the Adobe® Flex® Builder’s™ Build Project option for your Flex Library Project or the compc command-line compiler.

No comments:

Post a Comment