Skip to content

Cache events #85

Open
Open

Description

@michaelhall923

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

Local Storage

  • Cache profiles
  • Cache notes

In Memory

  • Cache profiles
  • Cache notes

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

Activity

  1. SamSamskies commented on Jun 20, 2023

    @SamSamskies
    Contributor

    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.

  2. SamSamskies commented on Jun 20, 2023

    @SamSamskies
    Contributor

    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.

  3. michaelhall923 commented on Jun 20, 2023

    @michaelhall923
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions