Constantly Ajax Request ?

29 views
Skip to first unread message

sailor...@gmail.com

unread,
May 12, 2009, 7:36:13 PM5/12/09
to Lift
Hi :

I would like to know what's the constantly sending Ajax Request? Is
it for the session keep alive??
Is there a way to disable it? Thanks

David Pollak

unread,
May 12, 2009, 7:45:15 PM5/12/09
to lif...@googlegroups.com
If you have a comet component on the page, Lift keeps an http connection open to the server waiting for server state change.  If you do not want the persistent connection, please remove comet components (those marked with <lift:comet .../> from your page.
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

Timothy Perrett

unread,
May 12, 2009, 7:47:18 PM5/12/09
to Lift
Is he not talking about the page GC? Id hazard a guess that he is...

Cheers, Tim

On May 13, 12:45 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> If you have a comet component on the page, Lift keeps an http connection
> open to the server waiting for server state change.  If you do not want the
> persistent connection, please remove comet components (those marked with
> <lift:comet .../> from your page.
>
> On Tue, May 12, 2009 at 4:36 PM, sailormoo...@gmail.com <
>
> sailormoo...@gmail.com> wrote:
>
> > Hi :
>
> >  I would like to know what's the constantly sending Ajax Request? Is
> > it for the session keep alive??
> > Is there a way to disable it? Thanks
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
May 12, 2009, 7:54:19 PM5/12/09
to lif...@googlegroups.com
On Tue, May 12, 2009 at 4:47 PM, Timothy Perrett <tim...@getintheloop.eu> wrote:

Is he not talking about the page GC? Id hazard a guess that he is...

Nope... the GC happens once every 75 seconds (by default).  It's not constant.
 



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

Timothy Perrett

unread,
May 12, 2009, 8:01:36 PM5/12/09
to Lift
This im aware of - however it just seems more likely that if he
"asked" for comet behavior by inserting the comet tag he would
associate the two. However, the way the original query was worded
indicated to me at least that he was not expecting the ajax calls...
hence why i think he's probally talking about the GC page ajax rather
than a comet call. Generally speaking people tend to exaggerate, hence
his miss-use of "constantly".

I may be wrong, but i have a hunch...

Cheers, tim

ngug

unread,
May 12, 2009, 8:44:51 PM5/12/09
to Lift
Well since he may have meant that, to disable it you put in Boot:
LiftRules.enableLiftGC = false

sailor...@gmail.com

unread,
May 13, 2009, 7:14:23 AM5/13/09
to Lift
Hi Hi :

Thanks for the answer but what's the LiftGC used for??
What's the difference between enabling it and disabling it ?
Thanks.

David Pollak

unread,
May 13, 2009, 9:02:01 AM5/13/09
to lif...@googlegroups.com
On Wed, May 13, 2009 at 4:14 AM, sailor...@gmail.com <sailor...@gmail.com> wrote:

Hi Hi :

 Thanks for the answer but what's the LiftGC used for??

Lift associated opaque GUIDs rendered to the client with functions on the server.  This allows you to associate an HTML element with a function so that when the HTML element is submitted to the server (e.g., form processing, Ajax components, etc.)

The functions and GUIDs are stored server-side.  In order to reduce the memory footprint of sessions, Lift garbage collections functions that have not been seen on any displayed page in a 10 minute period.  In order to know what pages are currently being displayed, a heartbeat is sent from each page in the client to the server every 75 seconds.  This allows the server to mark GUIDs as "still on an active page."
 

 What's the difference between enabling it and disabling it ?

GUID/function pairs will not be removed from sessions until the sessions are terminated if GC is disabled.
 

 Thanks.


Reply all
Reply to author
Forward
0 new messages