tvhnet2013
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.
marco.testa
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
tvhnet2013
Thanks Marco.
Is there any option to set LS keep or clear cached data of a specific item in case of no subscription?
marco.testa
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.
tvhnet2013
Thanks Marco.