On Sat, Nov 28, 2009 at 12:12 AM, Markus Kohler <[email protected]>wrote:
> Hi all, > As far as I can see by looking into the HTTP responses with Firebug, ESME > always sends the whole list of messages back to the browser. Uncompressed > this was in my case about 43 Kbyte( haven't checked how much it is > compressed), which is significant for a single message update. > > I wonder whether there would be a way in Lift to incrementally update the > page e.g. sending only the new messages, insert them into the DOM and maybe > delete the last messages from the DOM to avoid an unlimited increase of the > browsers memory usage. > Sure. Lift's comet actor can send a pile of JavaScript as a partialUpdate. As long as you can figure out what JavaScript to execute on the browser to incrementally update the data in the browser and then trigger a partial redraw, Lift supports this. > > Where could I look in the code to understand, how it is currently done? > PublicTimeline.scala Timeline.scala Note the reRender calls. These cause the whole shooting match to be sent. You can see an example of partialUpdate in http://github.com/dpp/liftweb/blob/master/lift-examples/example/src/main/scala/net/liftweb/example/comet/Chat.scala > > Regards, > Markus > > > "The best way to predict the future is to invent it" -- Alan Kay > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics
