How It Works
Package data is identified by content-addressed SHA-256 hashes. This means:- The same package content always has the same ID
- Multiple content items can share the same package data
- Packages can be cached indefinitely (they’re immutable)
- Subscription payloads stay under AWS 128KB WebSocket limit
Two Resolution Approaches
Full Resolution (resolved)
Useresolved when you need all package data in a single request:
Reference Resolution (resolvedRef)
UseresolvedRef for optimal caching and smaller payloads:
Fetching Package Data
Query package data by ID (only if not cached):Client Implementation
Caching Strategy
Handling Content with Caching
Subscription Handler with Caching
Draft Package Handling
Draft packages use a special ID format:draft:{projectId}:{organizationId}
Benefits
- Smaller Payloads: Subscription updates only include IDs, not full package data
- Efficient Caching: Content-addressed IDs mean packages never change
- Shared Data: Multiple content items referencing the same package share cached data
- WebSocket Compliance: Payloads stay under AWS 128KB limit
- Reduced Bandwidth: Only fetch packages once, regardless of how many content items use them
