Skip to content

Too many SPO REST calls required to use LoadListDataAsStream( ) #1383

@wizofaus

Description

@wizofaus

Category

  • Bug

Describe the bug

Currently due to the way PnPContextFactory.CreateAsync() works (always issuing at least 1 SPO REST call, 2 in my case), and the fact that I can't see how to get necessarily field data back from LoadListDataAsStreamAsync, I have to issue 4 separate SPO REST calls just to get the info I need from a library. With any sort of latency this can add up to a significant delay (500ms+).

Repro steps

Write minimal code for obtaining an IList from the PnP.Core library (e.g. PnPContextFactory.CreateAsync( ), context.Web.Lists.GetByIdAsync( )) then calling IList.LoadListDataAsStreamAsync() and monitor the number of HTTP calls issued and the time taken for them to execute fully.

Expected behavior

Ideally only a single SPO REST call is issued, two at most. Even caching previous results I can't really see how to reduce it from 4, and I'm not sure if it's sensible/safe to cache PnPContext / IList etc.

Environment details (development & target environment)

  • SDK version: 1.11.0
  • OS: Windows 10
  • SDK used in: ASP.Net (Core) Web app
  • Framework: .NET Core v8.0
  • Browser(s): N/A
  • Tooling: Visual Studio 2022
  • Additional details: The more context you can provide, the easier it is (and therefore quicker) to help.

Additional context

Thanks for your contribution! Sharing is caring.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions