构建单独的.swc是否允许更快地加载应用程序?

时间:2021-11-07 05:25:29

Our application is a bit slow to load at startup, i'm wandering myself if a sepation of the module of the application in several swc will decrease the loading time( grosso modo : a module = a "page" )

我们的应用程序在启动时加载有点慢,如果在几个swc中应用程序模块的sepation将减少加载时间(格罗索模块:模块=“页面”),我自己徘徊

2 个解决方案

#1


SWC is simply a compressed zip-like archive of classes (static library)/ Compiling an application against SWC doesn't change the outputted swf. There are 2 means by which you can decrease the initial loading:

SWC只是类的压缩zip类存档(静态库)/针对SWC编译应用程序不会更改输出的swf。有两种方法可以减少初始加载:

1.RSL - dynamic library which are loaded separately from the application and can be cached. Any RSL signed by Adobe can be cached not just by the web browser which is platform-dependent caching, but also by the flash player itself, which means that even if a user clean its browser cached or has no cache at all, once the RSL is downloaded, it's cached.

1.RSL - 动态库,与应用程序分开加载,可以缓存。任何由Adobe签名的RSL都不仅可以通过依赖于平台的缓存的Web浏览器进行缓存,还可以通过Flash播放器本身缓存,这意味着即使用户清理其浏览器缓存或根本没有缓存,一旦RSL是下载的,它是缓存的。

This is typically useful for runtime loading of the flex framework & the RPC. The other type of RSL caching like said earlier is browser caching. Either way, RSL is loaded at startup.

这通常适用于Flex框架和RPC的运行时加载。如前所述的另一种类型的RSL缓存是浏览器缓存。无论哪种方式,RSL在启动时加载。

2.The other way is by extracting parts of the application into modules, which will be loaded by demand. For example, if the application has 3 screen, each screen will probably be loaded ["probably", because it's up the developer to decide when] only when the user first enters this screen

另一种方法是将应用程序的一部分提取到模块中,这些模块将按需加载。例如,如果应用程序有3个屏幕,则每个屏幕可能会被加载[“可能”,因为只有当用户第一次进入此屏幕时才由开发人员决定何时]

#2


It depends on what is making startup slow. Is it slow after the SWF has been cached by the browser? If so then you need to just better structure your code so that not so much is happening on startup. You can defer creation of object by setting the creationPolicy property on components. If the slowness is being caused by the size of the SWFs then using the framework RSLs and partitioning into Modules will help reduce the initial download size.

这取决于什么使启动慢。在SWF被浏览器缓存后,它是否很慢?如果是这样,那么您需要更好地构建代码,以便在启动时不会发生这种情况。您可以通过在组件上设置creationPolicy属性来推迟创建对象。如果缓慢是由SWF的大小引起的,那么使用框架RSL并分区到模块将有助于减少初始下载大小。

#1


SWC is simply a compressed zip-like archive of classes (static library)/ Compiling an application against SWC doesn't change the outputted swf. There are 2 means by which you can decrease the initial loading:

SWC只是类的压缩zip类存档(静态库)/针对SWC编译应用程序不会更改输出的swf。有两种方法可以减少初始加载:

1.RSL - dynamic library which are loaded separately from the application and can be cached. Any RSL signed by Adobe can be cached not just by the web browser which is platform-dependent caching, but also by the flash player itself, which means that even if a user clean its browser cached or has no cache at all, once the RSL is downloaded, it's cached.

1.RSL - 动态库,与应用程序分开加载,可以缓存。任何由Adobe签名的RSL都不仅可以通过依赖于平台的缓存的Web浏览器进行缓存,还可以通过Flash播放器本身缓存,这意味着即使用户清理其浏览器缓存或根本没有缓存,一旦RSL是下载的,它是缓存的。

This is typically useful for runtime loading of the flex framework & the RPC. The other type of RSL caching like said earlier is browser caching. Either way, RSL is loaded at startup.

这通常适用于Flex框架和RPC的运行时加载。如前所述的另一种类型的RSL缓存是浏览器缓存。无论哪种方式,RSL在启动时加载。

2.The other way is by extracting parts of the application into modules, which will be loaded by demand. For example, if the application has 3 screen, each screen will probably be loaded ["probably", because it's up the developer to decide when] only when the user first enters this screen

另一种方法是将应用程序的一部分提取到模块中,这些模块将按需加载。例如,如果应用程序有3个屏幕,则每个屏幕可能会被加载[“可能”,因为只有当用户第一次进入此屏幕时才由开发人员决定何时]

#2


It depends on what is making startup slow. Is it slow after the SWF has been cached by the browser? If so then you need to just better structure your code so that not so much is happening on startup. You can defer creation of object by setting the creationPolicy property on components. If the slowness is being caused by the size of the SWFs then using the framework RSLs and partitioning into Modules will help reduce the initial download size.

这取决于什么使启动慢。在SWF被浏览器缓存后,它是否很慢?如果是这样,那么您需要更好地构建代码,以便在启动时不会发生这种情况。您可以通过在组件上设置creationPolicy属性来推迟创建对象。如果缓慢是由SWF的大小引起的,那么使用框架RSL并分区到模块将有助于减少初始下载大小。