Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Query Cache Implementation #40

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

josemak25
Copy link

@josemak25 josemak25 commented Oct 1, 2024

PR Summary: Solving Redundant Query Waterfall Issue (#2)

This PR addresses Issue #2, which relates to redundant queries being triggered when multiple components request the same data at the same time. This often leads to a "query waterfall" where unnecessary re-fetches occur, resulting in performance inefficiencies.

Solution:

  • Shared Cache Manager:

    • A new shared cache system is introduced to prevent duplicate queries.
    • This cache stores query results and shares them across all hook calls that request the same data.
  • Batching Queries:

    • When multiple components trigger the same query simultaneously, the cache manager batches these requests and returns a single result to all of them, eliminating redundant fetches.

By using this shared cache, we reduce unnecessary network calls and improve performance, especially in scenarios where many components are consuming the same query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant