Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Add optional user doc caching #4

Open
lorensr opened this issue May 23, 2016 · 5 comments
Open

Add optional user doc caching #4

lorensr opened this issue May 23, 2016 · 5 comments
Labels
feature Feature: new addition or enhancement to existing solutions help wanted

Comments

@lorensr
Copy link
Contributor

lorensr commented May 23, 2016

Instead of just caching the userId. Configurable cache duration, ability to go through or invalidate.

@lorensr lorensr added feature Feature: new addition or enhancement to existing solutions help wanted labels May 23, 2016
@stubailo
Copy link
Contributor

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

@lorensr
Copy link
Contributor Author

lorensr commented May 23, 2016

Nice, can you repair the cached doc with observed changes, or do you
refetch or delete?

On Monday, May 23, 2016, Sashko Stubailo notifications@github.com 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
#4 (comment)

@stubailo
Copy link
Contributor

I think observe just gives you the whole new document right?

@lorensr
Copy link
Contributor Author

lorensr commented May 23, 2016

Ah, yes – it's observeChanges that only gives the fields

http://docs.meteor.com/api/collections.html

On Monday, May 23, 2016, Sashko Stubailo notifications@github.com 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
#4 (comment)

@lorensr
Copy link
Contributor Author

lorensr commented Jun 30, 2016

Pseudocode for this: #19 (comment)

@lorensr lorensr mentioned this issue Feb 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature: new addition or enhancement to existing solutions help wanted
Projects
None yet
Development

No branches or pull requests

2 participants