-
August 16th, 2013, 10:45 AM
#1
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.
-
August 16th, 2013, 05:40 PM
#2
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
-
August 18th, 2013, 04:26 AM
#3
Thanks Marco.
Is there any option to set LS keep or clear cached data of a specific item in case of no subscription?
-
August 19th, 2013, 09:51 AM
#4
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.
-
August 20th, 2013, 03:37 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 01:37 AM.
Bookmarks