Open michaelhall923 opened 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.
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.
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.
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