Flash Site Optimization


One very important thing that a lot of web developers forget is making a site that is optimized. What I mean with optimized here is for the site to only do things and load things that is necessary for the it to perform properly.

 

It is understandable since computer and internet connection are getting faster and faster, that developers sometimes forget about those still using a 56K dial up connection. I myself don’t normally invest too much time into optimizing the sites I develop until I started working at my current company where they pay attention to every pixels, download time and always pushing and changing stuff to get the end result better and better. I guess that is what separate a good site and a great one. It is a lot of hassle, but I believe these small and yet actually important details are the things that can help get your skill and knowledge to the next level. Am I glad to be around all these talented people or not?

 

Back to the topic. There are 2 ways to tune up your site. First is through the client side elements, and Second is through the server side.

1. Client Side

-Refactoring. - This one is obvious. The lesser the lines of codes that you write, the smaller the file size is going to be. Sometimes it is good to refactor your code to improve perfomance, since the second time round you look at the code you can actually take out a good chuck of unnecessary code excecution.
-Assets optimization. - Cutting down the file size of the image assets used in Flash. For example often times using an image with quality 90% and 60% is almost the same visually. So why use 90% if 60% looks alright.
-Omit trace actions. - For the final release it is good to omit trace actions. First it prevents people from seeing the swearing you use in your trace statement. Secondly, it can also cut down your file size quite a lot depending on how much you put traces in the codes.
-Asset / Font sharing - This one is a good one. Most Flash sites now use multiple files that is loaded by the master.swf file. So instead of embedding fonts and exporting assets in every single external component, sharing those might cut down size tremendously. Check out Informit if you need to find out how to do this.
-Class Exclude. - This one is also a good one. Basically what this means is that instead of having to export every classes in every external clips, you might be able to share some of those classes that are used across the clips. Check out www.martijndevisser.com if you need to find out how to do this.

 

2. Server Side

-Caching. - Turning this on means that components that has been loaded once does not have to be loaded again and again.

In Apache webserver this is how to turn this thing on

First you have to turn on this module LoadModule expires_module modules/mod_expires.so

Second add this codes
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/x-shockwave-flash “access plus 1 months”
ExpiresDefault “access plus 1 days”
</IfModule>

 

The above tips should be able to save quite a bit of loading time. I am sure there are more ways to even improve perfomance further. So feel free to drop a line to share it.

 

Add comment