简体   繁体   中英

How to decrease initial load time in Gwt multiple entry point project app

I am using java with Google Web Toolkit. The problem is when a client uses our app, about 1.1 Mb is downloaded and it takes too much time to load initially.

Does anyone know how we can decrease the initial load time in our Gwt multiple entry point project app?

The official Docs came up with some bullet points

  1. Enable compression
  2. Remove unused CSS
  3. Minify JavaScript
  4. Minify CSS
  5. Minify HTML
  6. Defer loading of JavaScript
  7. Optimize images
  8. Serve scaled images
  9. Serve resources from a consistent URL.

Apart from that the , next immediate step we can look into Code Splitting. .

As much as you can reduce the load in onModuleLoad() ,That's greatly helps you to bring the app to client much faster.

And also Compile Time Reports helps you greatly where you are digging too much into Object.

On top of these,You are able to enable the gzip for your server ,Which compresses the data in gzip format to client .

More over the standard java coding techniques(respective to GWT) while coding.

Use an ArrayLists instead of Lists , HashMap's instead of Map's then GWT compiler does not need to compile the code for all possible implementations of the List ,Map's etc.

Use StringBuilder's instead of String's. ..etc

And some more techniques here Google I/O presentation by Ray Rayan.

I dont know what version of the api you are using for it. You can use the Code Splitting feature to improve the performance. You can check this here .

1) You can use gzip configuration to decrease the size of your images, html, css, text, javascript etc. files. here is the link

2) You can Turn on the Browser Compression: here is the link turn on browser compression

3) You can use compiler report which will help you to know which package is using more size. And then you can optimize your code.

Maybe you should split your app. Read this page of doc that may be of some help : http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM