Lift has built-in Lazy Loading.
How hard is the code? Here's the display part of the code:
Listing:
/lazy.html
<div class="lift:LazyLoad">
<span class="lift:LongTime"> I started this computation at
<span id="start">start</span> and it
completed at <span id="end">end</span>.
</span>
</div>
That's not a lot of markup code. Just mark the
block of markup that's going to take a long time to
calculate. Lift takes care of the rest.
Let's look at the snippet code:
Listing:
/net/liftweb/seventhings/snippet/LongTime.scala
/**
* Do something that takes a long time to do
*/
object LongTime {
def render = {
// capture the start time
val start = now
// sleep for up to 15 seconds
Thread.sleep(randomLong(15 seconds))
// send the result back
"#start" #> start.toString &
"#end" #> now.toString
}
}
Most other frameworks don't have lazy loading as part of
the core framework. It's generally very hard to do, but
because Lift has excellent
comet
support, it's easy to "push" content from the
server to the browser.