Why usingCaching() method doesnt working in IE 11
I use usingCaching() to performance the query. Method works great in Chrome.
My Chaching configuration:
pnp.setup({
defaultCachingStore: "session", // or "local"
defaultCachingTimeoutSeconds: 120,
globalCacheDisable: false // or true to disable caching in case of debugging/testing
});
Test request time:
var start_time = new Date().getTime();
let empObjects = await pnp.sp.site.rootWeb.lists.getByTitle("myEmps").items.usingCaching().get();
var request_time = new Date().getTime() - start_time;
console.log(request_time);
In Chrome: First request: 389ms After reload page: 92ms
In IE11: First request: 476ms After reload page: 401ms
What is the reason? Thanks previously!
Category
- [x] Question
- [ ] Typo
- [ ] Bug
- [ ] Additional article idea
Have you tested the requests in the same window or have you close the window and reopened it?
The reason I'm asking is that IE11 as a confirmed bug in handling local storage in different windows.
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/110656/
See my updated question. I use Session storage. I apologize for lying to you..
Since we don't see on your code what you are actually caching in your session. There are might be other issues that make problems with the sessionStorage too.
https://caniuse.com/#search=sessionstorage
In addition, can you write the global variable sessionStorage in your console?
console.log('Session Storage:', sessionStorage)
To see if something is stored right before you write to the sessionStorage. The first time you will get an undefined or just the items SharePoint Stores there by default. The second time your entries should be visible.
Based on OP's reaction to last comment, seems like the issue is resolved.
But regardless, the method in question is related to PNPJS, not SharePoint / SPFx so it doesn't belong here, rather belongs in the PnPJS issue list.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues