stemstr / Client

Stemstr client applications
https://stemstr-client-ten.vercel.app
GNU General Public License v3.0
26 stars 7 forks source link

Cache events #85

Open michaelhall923 opened 1 year ago

michaelhall923 commented 1 year ago

This is contingent on there being a localStorage cache adapter for NDK.

Local Storage

In Memory

NDKCacheAdapter: https://github.com/nostr-dev-kit/ndk/blob/master/src/cache/index.ts

Example implementation (Redis): https://github.com/nostr-dev-kit/ndk-cache-redis/blob/master/src/index.ts

SamSamskies commented 1 year ago

do we really want to cache profiles in local storage? i feel like we should always request new profiles on page load. it's not an expensive query and this way we won't have an stale profile info bugs.

SamSamskies commented 1 year ago

caching the events are tricky cause we have all different kinds of queries. i looked into it for a while and couldn't figure out a nice way to do it, so i punted on it.

michaelhall923 commented 1 year ago

main reason i wanted that was to prevent the notes flickering blank profiles when the page loads, but i guess you solved that by querying the profiles before rendering the feed.