0

Apache Compression

Actually, when I worked out with GWT Code Splitting, I still not satisfied with the result.
I know the web browser support content compression so a gave it a look.I chose to use the most simple solution, Apache compression. I just need to set .htaccess configuration and copy to your web folder.

Steps :

1. Enable Apache mod_deflate. mod_gzip is better but I don't have the extension. Open Apache configuration file and turn on the settings.

LoadModule deflate_module modules/mod_deflate.so

2. Create .htaccess file and paste these configuration. I want to compress all files with js, css, html, htm and php extensions.


<FilesMatch "(?i)^.*\.(js|css|html|htm|php)$">
SetOutputFilter DEFLATE
</FilesMatch>

3. Restart Apache. Done.

Try to open your web and use firebug to see your file downloads.
I was successfully, reduce the file download from 600Kb (After GWT code splitting) to 250Kb. So the total I saved around 800Kb and speed up my system.
0

GWT Code Splitting

In my GWT + GXT project, the obfuscated javascript output file is around 1.1MB. It takes quite long for the browser to load all the files before the system is running. So I gave a look on GWT code splitting.

It's very simple and just need to implement
  1. GWT.runAsync(new RunAsyncCallback() {}
  2. Set GWT compiler parameter : -compileReport. Make sure you disable draft compile mode since it will not produce the SOYC(Story of your compile)

You can see the compile report as you know what is going to be downloaded on initial download, full download and leftover.

http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html
http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html

Soon I will try to reduce the usage of the GXT library which is the most codes included in my initial download.
 
Copyright © peyotest