Add support for caching in the SDK
@sebastienlevert is already working on this.
Since Jan 4, 2022.
Assessment
This issue has not been assessed yet.
Description
Feature Request
Is your feature request related to a problem? Please describe
Say you're building an app connected to Microsoft 365 where you want to show your colleagues, upcoming meetings and recent files. All these objects have information about users on them. If for each person you wanted to show their name, photo and presence, you might end up requesting the same data from Graph multiple times. If you navigate between pages in your app, you'd keep unnecessarily downloading the same information over and over again.
Describe the solution you'd like
It would be invaluable if the SDK allowed us to cache previously retrieved data. If the data has been retrieved previously and it hasn't exceeded its expiration time, it would be loaded from the cache without calling Graph. That would make a huge difference in the app's performance and would probably help developers avoid throttling in data-heavy apps.
Similar functionality is already available in the Microsoft Graph Toolkit and it would be great if it was also available in the Graph SDK in cases developers can't use MGT.
Describe alternatives you've considered
I've experimented with building a Cache middleware for the Graph SDK which you can find here: https://gist.github.com/waldekmastykarz/654157658bc905e263ddd54c24fef7e2. The cache middleware allows you to configure cache settings on a Graph path so that you can configure different cache settings for different resources. You can also choose not to cache specific requests. The middleware supports caching JSON as well as binary data (like user's photo).
Is this something that you'd consider including in the Graph SDK?
AB#8900
- Dominant language
- TypeScript
- Stars
- 833
- Forks
- 240
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Is anyone here? Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reaction ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Openstatus:waiting-for-triage
Difficulty 5/5 Over a week Newbie friendliness 42/100
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 comments · 1 reaction ·
-
status:waiting-for-triage type:bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoftgraph/msgraph-sdk-javascript
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100