D
D
dodu2014-09-02 16:00:02
JavaScript
dodu, 2014-09-02 16:00:02

How to use cache in meteor app?

Good afternoon. Discovered js, node.js and meteor. I'm experimenting with writing an application on a meteor. I want advice from wise theorists and practitioners. The task is to get the most independent application in the browser that can do without a server when possible, for which the application should have reasonable caching.
For example: there is a collection with blog posts, consisting of 1000 entries. From time to time, the client requests any three of them:
5, 69, 70
12, 7, 90
69, 70, 72.
On the meteor, I found the option to either subscribe and immediately download the entire collection (which, of course, is not very reasonable), or renew the subscription and lose the past received data. I also need that if the data was previously loaded, then they are saved and, when accessed, are no longer loaded from the server.
Now I use an array as a layer where I add data, and after forming a new request, I first check their presence in the array and only then make a request. And so for each such case.
To what extent this approach is combined with the philosophy of the framework, maybe there are better ways? It seems to me that it would be ideal to form a collection structure without data on the client, and when accessing it, already download it from the server, storing several megabytes of cache on the client.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-09-02
Protko @Fesor

docs.meteor.com/#dataandsecurity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question