0

I'am trying to improve the performance of my gwt app.

My app uses a lot of rpc request, so i am trying to caching them in the client.

Each rpc request returns a list of records (normally 100 records). I'am storing them in the client as a Java List, but I notice that the browser can not carry ok with this amount of objects. It performance cracks.

I'am thinking of storing the result of each request into a cookie using some kind of JSON and retrieving it when needed. In other words, caching the request in cookies better than in the RAM of the client browser.

Can somebody suggest me anything? Will I success by following this approach or is this a stupid think? Does anybody has a better solution?

Cœur
  • 37,241
  • 25
  • 195
  • 267
amanas
  • 490
  • 5
  • 8

4 Answers4

2

Maybe you want to have a look at this question: Client side caching in GWT

Community
  • 1
  • 1
fab
  • 1,839
  • 15
  • 21
1

Cookies are actually a terrible place to store stuff, because they get sent to the server on every request, even RPC (Ajax) requests.

I think what you want is local storage, which has some kind of implementation in every modern browser. Not sure about older IE's but you could fall back to Flash for local storage there.

Edit

GWT doesn't have any native support for local storage (that I know of) but you could always use JSNI for that.

Also storing stuff in JS is a perfectly valid way to do it, you just need to make sure stuff expires and falls out of the cache. Is your current cache solution just growing forever? Because that certainly will kill the browser eventually.

jpsimons
  • 27,382
  • 3
  • 35
  • 45
0

The cookie is sent as a field in the header of the HTTP response by a web server to a web browser and then sent back unchanged by the browser each time it accesses that server.

think about the traffic...

hope_is_grim
  • 1,934
  • 15
  • 24
0

@darkporter I completely agree and would like to add that Web Storage support are coming in the next GWT 2.3 release. So if you need it right now, you could pull those classes from gwt trunk and use them in your project.

nordlig.ulv
  • 125
  • 6