meteor-integration
meteor-integration copied to clipboard
Add optional user doc caching
Instead of just caching the userId. Configurable cache duration, ability to go through or invalidate.
You know what would maybe be even better? Just using an observe on the user IDs to invalidate the cache. Then it's guaranteed to work. Note that Meteor already does this to invalidate currently logged in users when passwords are reset or login tokens deleted:
https://github.com/meteor/meteor/blob/0a402c75376e68c4781bf636bcf3dfd0ae27a045/packages/accounts-base/accounts_server.js#L884-L951
Nice, can you repair the cached doc with observed changes, or do you refetch or delete?
On Monday, May 23, 2016, Sashko Stubailo [email protected] wrote:
You know what would maybe be even better? Just using an observe on the user IDs to invalidate the cache. Then it's guaranteed to work. Note that Meteor already does this to invalidate currently logged in users when passwords are reset or login tokens deleted:
https://github.com/meteor/meteor/blob/0a402c75376e68c4781bf636bcf3dfd0ae27a045/packages/accounts-base/accounts_server.js#L884-L951
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/apollostack/meteor-integration/issues/4#issuecomment-221045178
I think observe just gives you the whole new document right?
Ah, yes – it's observeChanges that only gives the fields
http://docs.meteor.com/api/collections.html
On Monday, May 23, 2016, Sashko Stubailo [email protected] wrote:
I think observe just gives you the whole new document right?
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/apollostack/meteor-integration/issues/4#issuecomment-221060252
Pseudocode for this: https://github.com/apollostack/meteor-integration/pull/19#issuecomment-228629726