Batch and cache SharePoint requests, or get throttled
SharePoint Online throttles chatty SPFx webparts. Fewer, larger requests fix most of it.
Anish KumarMicrosoft 365#spfx#sharepoint#performance
SharePoint Online limits how many requests a user or app can make. A webpart that loads a list,
then fetches each item's details one by one, will hit 429 Too Many Requests as soon as real users arrive.
What helps:
- Use
$selectand$expandso one request returns exactly the fields you need, including lookups. - Batch writes with the
$batchendpoint (or PnPjs batching) instead of one call per item. - Cache reads that rarely change — config lists, choice values — in session storage.
- Respect
Retry-After. When you are throttled, wait as long as SharePoint asks before retrying.
Test with a realistic list size. A list with 50 items in development hides problems that 5,000 items expose.