Browsers freeze for a moment while renderring views in GWT - gwt

I am still a beginner in GWT . Firstly I write a sample project and run it . And open with browser giving url by Development Mode of my Eclipse IDE. At this time , I noticed that my browser was stopped just a few seconds and I can't do anythings on my browser . If I have some other pages are loading to open , they also stop loading . I think in this time browsers will download JavaScript files these need to show my page. That is worse thing for me .
By using RPC , I retrieve many datas from my database and try to render to my view page. That may also happen stop for a moment to my browser. So , I had add a Gif image in my web-page and press some button to retrieve data and try to render my view page. Supprisingly , this Gif image also stop animation. Why has this situation happend with GWT project ?
I am testing it in localhost. Can I avoid it ? Any suggestions ? Thanks...

Development mode (localhost) is very different from the production mode. It is many times slower, and it requires a lot of memory. This is why your browser freezes. You can:
Try a different browser. You may have a better performance on your system.
Add memory to your computer.
Optimize your code. There are many ways to do it. As a first step you need to understand what causes a problem: processing data or rendering of a page.
Finally, deploy your code to the production environment and check if you experience the same problems.

Related

Material UI Tabs not rendering properly on server

I am having a problem using the "Tabs" component: https://material-ui.com/components/tabs/ In fact, when developing locally, the rendering of the component is fine. But pushing to the server, it looks weird (with differences in the borders on each side of the bar).
Moreover: when refreshing the page in which it has been embedded or browsing manually to this page, the whole template is broken all of a sudden!
I tried generating a build folder locally and launching the page from that build, and fell back on the same problem.
Thank you in advance for your help
From your description, I saw that your "build" is not work even in local development. That's mean it should not work on the production, of course.
The thing is, what is your actual "build" action? Depends on what library/framework you use, but basically with Material-UI, most popular problem comes from not load some CSS before using it's components.
Please read here first: https://material-ui.com/guides/server-rendering/#server-rendering
Just in case you use Gatsby, read here: https://www.gatsbyjs.org/packages/gatsby-plugin-material-ui/.
I'm using Gatsby and use this following config to fix some CSS issues.
stylesProvider: {
injectFirst: true,
}
Hope this help.

blank.html is downloaded multiple times

GWT is used and the application is deployed on WebLogic using HTTPS.
The performance is poor and with F12 Developer Tools, we could see that blank.html is downloaded multiple times. This is clearly related to GWT but we have not been able to figure out why.
The following is from javascript:
defineSeed(2613, 2614, makeCastMap([Q$BaseModelData, Q$ModelData, Q$Theme, Q$Serializable]), Slate_0);
var SLATE;
function $clinit_GXT(){
$clinit_GXT = nullMethod;
IMAGES = new XImages_generatedBundle_0;
MESSAGES = new XMessages__0;
SSL_SECURE_URL = getModuleBaseURL() + 'blank.html';
}
This is from GWT.java:
/**
* URL to a blank file used by GXT when in secure mode for iframe src to
* prevent the IE insecure content. Default value is 'blank.html'.
*/
public static String SSL_SECURE_URL = GWT.getModuleBaseURL() + "blank.html";
Does anyone know under what circumstances blank.html is called?
Thanks!
This is from GWT.java:
This is actually from GXT.java.
This is used in a few cases when creating an <iframe> element, so that IE won't give errors if your site is hosted from SSL. I can actually only find one case (as of GXT 3.1.1) which uses this, in Layer.java. Only IE pages loaded from https urls will make use of this.
The Layer class uses this as a "shim", a way to prop up some DOM elements above overs, and work around some browser bugs (typically plugin or iframe related). Menus and popup dialogs use this to ensure that they don't appear "underneath" content that they should be "above".
This file is very small - just enough HTML to convince IE than the iframe has correctly loaded, and no more. It never changes, and should load nearly instantly.
As far as performance goes, this should only happen when a Menu or Window/Dialog/Tooltip is shown - these shouldn't be happening on app startup usually, at least not more than a window or two. Additionally, the browser should recognize that it is loading the same element and cache it correctly, and not load it multiple times (though it might be listed several times as hitting the cache). If the server has instructed the browser to never cache the file, that is something you should look at changing.
In short, this is very unlikely to be the cause of any performance issues, at least in GXT itself. If somehow you have the shim enabled on every single widget in your project, this should not be required. If the file is loading slowly, something may be very wrong with your server configuration.
For reference, here is the entire file:
<html></html>

Zend framework 1 login slow

Generally my application response times are good and pages load quickly. However login, using Zend_Auth with mysql db, takes an age compared to other tasks. I'm wondering has anyone else encountered this?
If not can anyone suggest a good way to debug and find the cause of the slow down?
FYI most pages are rendered under a second after their link is clicked whereas login takes around 7 seconds.
First you need to figure out what is causing slowdown. Add this to your application.ini:
resources.db.setDefaultTableAdapter = 1
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
Then use Firefox+Firebug+FirePHP to see (in Firebug Console) list of all queries. Maybe one of them is really slow? Or maybe you make a lot of them?
Other thing to do is to check Net tab (Firebug) with 'keep changes' turned on to see if you don't make too many redirects or maybe some JS files are slowing down downloading page?
Last step is to install XDebug and run your login with XDEBUG_PROFILE parameter and then use KCacheGrind tool to see what is happening during login and what takes most time.
(Check manual)

GWT refresh modifications

I'm new to GWT and therefore have a lot of "code and see how it behaves" going on. I'm wondering what are the minimal actions to take to load the modifications in my web browser. For example when I work on the xml I can just refresh my page. So when do I need to perform these and why:
Refresh browser
Reload web server
Re build app
???
1. Refresh browser
You need to do this whenever you've made code changes in UiBinder or any other client side code.
Reload web server
This needs to be done when you've made any changes to the server side classes. This only works if you're using the embedded Jetty in Dev Mode (not if you're using -noserver).
Re build app
You only need to compile the app when you're getting ready to deploy it or you want to show someone. This could also be required if you want to test the app in a browser that doesn't have the GWT plugin.
When running the app in development mode, making code changes in UiBinder or client side code the changes will be visible in the browser after a simple refresh.
But you will not see the error logs in GWT's "development mode" window unless you reload the server. So, by just refreshing the window you might miss some simple mistakes and you app will block with no notifications.

How to empty cache for WebView?

I have a Webview that must load an image! When I upload this image I see every time the same image as before, and i must reboot my app to see the new image...
I think is a cache problem..How can I solve that??
One quick and easy method would be to append the current time stamp onto the url whenever you load it.
So instead of loading:
http://www.myhost.com/myimg.jpg
you'd load
http://www.myhost.com/myimg.jpg?12345689
Using a cache breaker like this is a very common method in web development to force reloading of content.
I did do some quick googling and it appears clearing out NSURL's cache won't do the trick. In 10.6 the api reloadFromOrigin: may do the trick, but I'm not aware if this has made it's way onto the iphone yet.
Edit:
I found this page in the docs. It looks like you can use the preferences system to say whether or not to use caching. Not tested, but that'd be something to look at.