0

I understand that client cursors (ie. collection.find) only query the local cache (minimongo). Also, a subscription will typically (always?) make a request against a server-side publication, causing records to be pushed to the client and cached.

My question: do subscriptions attempt to locate a locally cached version of their request before receiving a result-set from a server-side publication?

I realize this would be complicated as only the publication knows the full nature of the query that it is publishing. But it would be possible.

Paul
  • 9,285
  • 6
  • 29
  • 37
  • Hi, David. It looks like you mistakenly marked my question as a duplicate. Looking at your profile, it looks like you know a lot about meteor and you probably could help answer this question. Also, I have noticed that when someone erroneously marks a question as a duplicate it discourages others from trying to answer it. It seems a shame to re-post this question. Are you able to "un-mark" it a duplicate? Or perhaps stackoverflow does not support that. – Paul Sep 20 '15 at 18:55

1 Answers1

0

You might have seen that when you open your app for the first time on a new browser or from a new address, the blank screen remains for a little longer. This is primarily because subscriptions aren't ready, and when they are, all the templates that require them get rendered. But when you open your app again or simply refresh, things happen significantly faster. So there are few things to consider:

  1. Yes, minimongo on the client does store the cached documents.
  2. Yes, the client does know when it's time to fetch new data from the collection on the server via pub/sub. This happens because the server notifies the client about it.
  3. Most of the time, there's no need to explicitly and forcefully update the data on the client. But if you want, there's a Q&A for that.

In general, it helps to read about what reactivity means in context of Meteor (i.e. how it has been implemented): Reactivity Basics: Meteor's Magic Demystified.

Community
  • 1
  • 1
rishat
  • 8,206
  • 4
  • 44
  • 69
  • Thanks, Rishat. I re-phrased my question to make sure it was clear. I am trying to understand what happens "under-the-hood" with meteor subscriptions. perhaps you know... – Paul Sep 20 '15 at 19:07