Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jul 2013
    Posts
    39

    Item data cache if no subscription

    Hi,

    My LS javascript client connected to server and got data with no problem. If I open another browser and run that LS javascript client, it works the same.
    However, if I close all browser (that will unsubscribe item at data provider), and then open new browser, run LS javascript client again, it got no data.

    I don't know if it is my error or LS default behavior.

    1. Does LS auto clear item data cache if no subscription?
    2. Or my data provider must "resend" snapshot when got new subscription?

    Thanks in advance.
    Last edited by tvhnet2013; August 16th, 2013 at 12:27 PM.

  2. #2
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi,


    actually both:
    1) if there are no subscription for an item, the Lightstreamer Server dos not hold any cached data for that item.
    2) at the first subscription for a given item, since the server does not have any cached data, it ask the data adapter to provide the snapshot.
    For the subsequent subscriptions for the same item, the server does not ask anything, since it is receiving all the updates from the adapter and thus it has already the snapshot it has to send to the just subscribed client.


    hth,
    Marco

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Posts
    39
    Thanks Marco.

    Is there any option to set LS keep or clear cached data of a specific item in case of no subscription?

  4. #4
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi,


    no, there isn't an option to let the server keep the cached data even if there isn't any subscription for the given item.
    Actually such option could lead to a memory leak, since the server will retain data for all the items subscribed at least one time in the past, and the server cannot know if a client will ever return to subscribe an item again.
    What you should do is to have a dedicated long living client, which has the sole purpose of keeping at least one subscription for the given items you want to keep in the server cache. From this client you can control which item should be cached or not, and for how long. This client may be deployed on the server host and should start with the LS Server.

  5. #5
    Senior Member
    Join Date
    Jul 2013
    Posts
    39
    Thanks Marco.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:11 AM.