Tuesday, July 15, 2014

Re: The First-Time loading issue of a deployed GWT app?

Someone told me to put the "<script type="text/javascript" language="javascript" src="myproject.nocache.js"></script>" inside the <body> tag rather than inside the <head> tag.

After doing that it seem that it had loaded the "loading" indicator right at the beginning before loaded the .nocache.js 

But I am not sure if i put the that js <script>..</script> inside the <body>, then will that cause any later problem?



On Tuesday, July 15, 2014 1:34:29 PM UTC+10, Tom wrote:

I deployed my app and I got this issue.

The first time the app got loaded, it will show a blank white page for 5-7 second which is pretty long for a good user-experience. But after that, the page show really really fast since it got cached.

The problem is that when i advertised my site in Adword. When many people will visit my site for the first time, they could be impatient if it shows a blank page for a long period time like that.

I think the solution is to make an loading indicator to indicate user that the page is loading.

Actually I did do the indicator loading at the onModuleLoad method

public class MyProject implements EntryPoint {    private final ClientGinjector ginjector = GWT.create(ClientGinjector.class);    @Override  public void onModuleLoad() {      // This is required for Gwt-Platform proxy's generator      DelayedBindRegistry.bind(ginjector);        ginjector.getPlaceManager().revealCurrentPlace();      DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById("loading"));    }  

}

In MyProject.html

<html>       <head>......</head>       <body>          <div id="loading">             Loading<BR/>             <img src="../images/loading.gif" />          </div>          <iframe.......></iframe>          ......        </body>  </html>  

However, the <div id="loading"> only works after all javascript files got loaded. It doesn't work right at the beginning user visits the site & that is why user will see a blank page for a pretty long time.

I am not sure GWT app is good for advertising in Google. But my page passed the Ad review from Adword people, so it means the page must be finally visible, otherwise Adword people will reject my page.

Can u figure out a solution for this?

http://stackoverflow.com/questions/24749396/the-first-time-loading-issue-of-a-deployed-gwt-app

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment