Skip to content

Add caching feature for links and update the example #64

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

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

Conversation

Abdo-Nabil
Copy link

Add caching f✨ What's New:

✅ Added caching feature:
New enableCaching boolean flag to toggle caching.
New cachingDuration parameter to control how long the data is cached.

🔁 Improved didUpdateWidget logic:
Enhanced handling of prop updates to avoid redundant fetches.
More efficient lifecycle updates when preview data changes dynamically.

🧪 Example project updated:
Now includes usage of the new enableCaching and cachingDuration parameters.
Serves as a practical guide for developers to adopt the feature quickly.

⚙️ Why This Matters
Improves performance when previewing the same links multiple times.
Reduces network calls, making the widget more efficient for chat or feed-based apps.
Makes the widget behavior more predictable in dynamic rebuild scenarios.

@Abdo-Nabil Abdo-Nabil closed this Jul 15, 2025
@Abdo-Nabil Abdo-Nabil reopened this Jul 15, 2025
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