sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Why usingCaching() method doesnt working in IE 11

Open geogikk92 opened this issue 8 years ago • 5 comments

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

geogikk92 avatar Apr 19 '18 06:04 geogikk92

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/

StfBauer avatar Apr 19 '18 09:04 StfBauer

See my updated question. I use Session storage. I apologize for lying to you..

geogikk92 avatar Apr 19 '18 14:04 geogikk92

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.

StfBauer avatar Apr 19 '18 15:04 StfBauer

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.

andrewconnell avatar Aug 09 '19 19:08 andrewconnell

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

msft-github-bot avatar Jan 28 '20 00:01 msft-github-bot