You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the required fields are not available in the cache, userCache simply calls _original() which causes the entire user object to be fetched from the db, even though userCache knows which fields are required.
If instead userCache were to only fetch the requested fields then less data may need to be fetched. If the developer stores lots of custom data on in the users db then this could be a significant saving.
I suggest an improvement similar to the following:
When the required fields are not available in the cache,
userCache
simply calls_original()
which causes the entire user object to be fetched from the db, even thoughuserCache
knows which fields are required.If instead
userCache
were to only fetch the requested fields then less data may need to be fetched. If the developer stores lots of custom data on in the users db then this could be a significant saving.I suggest an improvement similar to the following:
or just;
whichever you think will be most efficient.
I suggest this because before trying
userCache
I had hackedMeteor.user()
to do precisely this, so that:However, I cannot use my own hack alongside
userCache
, so I've had to hackuserCache
to incorporate my own hack.To provide benefit (2) you might also provide a similar client-side API with this:
However, although useful, that's a bit beyond the scope of
userCache
.What do you think?
The text was updated successfully, but these errors were encountered: