4 Replies Latest reply on Aug 28, 2006 10:48 AM by Flex harUI

    Flex apps too fat - file sizes / download times are a problem

    blahxxxx
      Hello

      We've built an application using Flex and it was too large (~400K - 500K) so we have tried to break the app up into small "mini flex apps" which are displayed as individual components on HTML pages. The theory being that small components will be significantly smaller in size, and only loaded as needed when the parent HTML pages are loaded.

      To our horror we have found that even the Flex mini apps that do basically nothing (for example display a menu at the top of the page) are a couple of hundred kilobytes each.

      Ouch! We really need some definitive advice on how to cut down the size of the application. It's quite a concern that Flex apps that do basically nothing need 100's of kilobytes - this means that Flex apps are really only viable for broadband users.

      Can anyone advise on a comprehensive set of strategies for reducing file size? In particular noting that we have broken our application up into many small Flex apps sitting on parent HTML pages.

      We've even tried implementing a shared library but it had only a trivial impact on file size - the menu at the top of the page is still 170K! It seems bizzare but we are now forced to consider implementing parts of our application as HTML because the file size of the Flex apps is just too big to be practical - perhaps anything non core should be implemented in HTML to reduce download file size.

      It's a worry because it appears that breaking the application up into many smaller mini apps does not decrease the size of flex code to be downladed by the end user, but has dramatically increased the aggregate total size of code that will be downloaded across the entire site/application.

      Thanks in advance.

      Andrew








        • 1. Re: Flex apps too fat - file sizes / download times are a problem
          inlineblue Level 1
          Umm, I think you're pretty much out of luck. If you're using any Flex components, the smallest possible app is going to be over 100K. This has been discussed here before and there's nothing that can be done at this point.
          • 2. Re: Flex apps too fat - file sizes / download times are a problem
            ntsiii Level 3
            I understand that Flex components can be compileds to not include the Flex framework.

            This is beyond my 2.0 experience though.

            You understand that the Flex swf is cached in the browser, and that the big hit is in the initial download? Subsequent start-up is much faster.

            Tracy
            • 3. Re: Flex apps too fat - file sizes / download times are a problem
              ntsiii Level 3
              But yeah, Flex RIAs need broadband, or very committed users.
              • 4. Re: Flex apps too fat - file sizes / download times are a problem
                Flex harUI Adobe Employee
                There is a lot of infrastructure in the Flex Framework (styles, events, layout, effects, etc). These come at a cost in download size, but makes it much faster to write an application than coding this stuff up on your own in Flash. The cost is about 120K for a mini-app. Using RSLs can help if you set it up properly, but the RSL will be 100K or so anyway. If you have a 100K RSL of core components, I would think a mini Menu app wouldn't be another 170K, but I could be wrong about that. However, it might be worth verifying that you got the RSLs setup properly.

                If your users are on dialup (5K/sec) then you have a 20 second startup problem, minimum. There's no doubt that the focus of Flex is based on the assumption of fast network connectivity, so if 20+ seconds is too much for a heavily dialup user-base then Flex may not be the right technology for you, but keep in mind that your HTML/Javascript pages will get big too as you start to do RIA interactivity in the browser.

                Keep in mind that Flex/Flash is a streaming technology. Every Flex app comes with a default preloader (the downloading/initializing progress bar). You can replace that preloader with your own and write a small non-Flex thing that shows something interesting to the user while they stream in the rest of the swf. You could put up a cheap login dialog, ask for user registration, show some billboards, play an animation, whatever. That stuff won't have to run again if the SWF is in the user's browser cache the next time they run the application.