开发者

What does GWT Download and Where?

We are running GWT using GWT开发者_Python百科-RPC. GWT-RPC is really JSON and is getting Eval()'ed in the client browser.

Since the browser doesn't cache what is Eval()'ed, then I imagine I would be re-downloading the whole app each time.

Are there library files, etc. which are brought down into browser cache? Has GWT found some tricky way to cahce what is Eval()'ed?

Thanks. Sean.


When you compile a GWT project, your Java code is transformed into a set of JavaScript files. This includes all your app code, any relevant code from the GWT libraries, and code from any external libraries you have chosen to use (Guava, Gin, Ext GWT, etc.). You'll see these in your war directory as <hashname>.cache.html. GWT RPC is only used while your app is running to retrieve server-side data – not any compiled JavaScript.

To avoid clients from downloading the entire app at each launch, you should set up your server to instruct clients to cache all *.cache.* files.

If you need to cache the results of GWT RPC calls, you should probably try to do this in your Java code.


Take a look at the "Organize Projects" section of the Google Web Toolkit docs for more information:

http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜