Backoffice Performance: Add inflight request deduplication to item data request managers#21767
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces in-flight request deduplication for all item data request managers in the Umbraco backoffice to prevent duplicate API calls when multiple UI components request the same items concurrently. The implementation adds a new UmbManagementApiInFlightRequestCache class and updates 20 item request managers to use it.
Changes:
- Introduced
UmbManagementApiInFlightRequestCacheclass to track in-progress requests per manager type - Modified
UmbManagementApiItemDataRequestManagerto deduplicate concurrent requests by checking inflight cache before making API calls - Updated all 20 item request managers to instantiate and provide a static inflight cache instance
- Added comprehensive unit tests covering deduplication scenarios and edge cases
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/management-api/inflight-request/cache.ts | New cache class for tracking in-flight requests with get/set/has/delete/clear operations |
| src/Umbraco.Web.UI.Client/src/packages/management-api/item/item-data.request-manager.ts | Core deduplication logic: splits IDs into cached/inflight/new, creates deferred promises per item, resolves from shared batch responses |
| src/Umbraco.Web.UI.Client/src/packages/management-api/item/item-data.request-manager.test.ts | Comprehensive test suite covering concurrent requests, cache behavior, and cleanup |
| src/Umbraco.Web.UI.Client/src/packages//repository/item/-item.server.request-manager.ts (20 files) | Each item manager now has a static inflight cache instance passed to parent constructor |
There was a problem hiding this comment.
This is working nicely @madsrasmussen - I don't see any isuses.
I've tested with this setup:
There are 9 unique documents.
I see these requests:
https://localhost:44339/umbraco/management/api/v1/item/document?id=59cdd01f-dc65-486d-84f3-95b8361fcd4f&id=49ac6099-cf51-458b-b9a4-0c1f55dc7902&id=616d0f54-b8b0-450e-be0d-2ca4c06672a2&id=eab72f13-b22e-46d5-b270-9c196e49a53b&id=cdb2bf78-8292-44a3-bff8-5d18aee64078
https://localhost:44339/umbraco/management/api/v1/item/document?id=6374bda9-034a-4109-a837-72ed6a325f11&id=49b422c6-d5b8-486d-8a31-be39345178b2&id=4f0b7052-d854-43b5-bb7c-6c82af4d96d1
https://localhost:44339/umbraco/management/api/v1/item/document?id=cd99be2a-42b8-4dec-94fe-94a3d5d99d64
Which matches up:
- Request 1, from property 3 - 5 items requested
- Request 2, from property 1 - 3 items requested (Emm, Poormina, Jeavon)
- Request 3, from property 2 - 1 item requested (Erica)
In comparison, with main - I see three requests each time for all items from the property.
|
@AndyButland Thanks for testing. I will merge this so it can be included in 17.3. |
Adds an in-flight request cache to all item data request managers to prevent duplicate API calls when multiple components concurrently request the same items. This has currently only been implemented when requesting "detail" data.
Problem
When multiple UI components request the same item data simultaneously (e.g., during page load), each request independently hits the server — even if another request for the same IDs is already in-flight. This results in redundant API calls and unnecessary load.
Solution
Introduces
UmbManagementApiInFlightRequestCacheas a static per-manager cache that tracks in-progress requests. When agetItems()call is made, the manager now:Concurrent calls with overlapping IDs will share the same server response rather than making separate requests.
Example
Testing Example
Document Pickers with overlapping selection

Network inspection
In total, we requested 6 items. Each picker requests only items that are not already cached or in-flight.