Skip to content

Conversation

@madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Aug 13, 2025

This PR introduces a client-side runtime cache to improve performance when loading Document Types and Data Types. This also includes Content Workspaces (Documents, Media, and Members), which all load structural data. The runtime cache means it will be cleared with a browser refresh.

When loading a Document Type or Data Type from the Management API, we cache the result to avoid re-requesting the server for the same data. The caching depends on a connection to the Server-Side Events hub for cache invalidation. If we don't have a connection, we won't cache anything.

The server events are emitted through a new UMB_SERVER_EVENT_CONTEXT that is made globally available. We can later use this when we introduce real-time updates in the UI.

The PR also introduces a Management API Detail Request Manager that handles all the logic around when and if to cache the data. It is used within the server data sources, as it's the server data source that needs caching.

How to Test / What to Look For:
When loading a document, you will see network requests to load all the composed document types and data types. When loading another document based on the same document type, the number of network requests for Document Types and Data Types will no longer happen.

@madsrasmussen madsrasmussen added release/16.3.0 category/performance Fixes for performance (generally cpu or memory) fixes labels Aug 13, 2025
@madsrasmussen madsrasmussen changed the title Feature: Client Cache for Document Types and Data Types Feature: Client Cache for Document Type and Data Type Detail Models Aug 15, 2025
Copy link
Contributor

@iOvergaard iOvergaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out:

  1. Went to a document type to cache it
  2. Went back and forth and saw no new request ✅
  3. Opened it in another tab
  4. Changed a property
  5. Went back to it in the first tab
  6. Saw a new network request and the refreshed content ✅

@iOvergaard iOvergaard merged commit a39bc0e into main Aug 18, 2025
27 checks passed
@iOvergaard iOvergaard deleted the v16/feature/entity-detail-runtime-cache branch August 18, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend category/notable category/performance Fixes for performance (generally cpu or memory) fixes release/16.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants