@contentauth/c2pa-web 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -104,7 +104,11 @@ const reader2 = await Reader.fromBlob(
104
104
 
105
105
  Each `Context` holds whatever single `Settings` object was passed to its constructor and does not handle any merging of settings. To combine more than one `Settings` source, merge them first with `mergeSettings()`, then construct a `Context` from the single, merged result. See [`c2pa-utilities`'s README](../c2pa-utilities/README.md#combining-settings) for details.
106
106
 
107
- A `Context`'s settings are resolved on its first use and then memoized for re-use. Passing the same `Context` instance to multiple `Reader`/`Builder` calls doesn't re-fetch trust-anchor URLs on every call.
107
+ Within each worker, Readers and Builders transfer their effective settings JSON into WASM once and reuse an owned context handle for subsequent construction, avoiding repeated settings transfer and parsing. Different resolved settings create a separate context generation. The worker retains at most 16 settings generations with first-in, first-out (FIFO) eviction and explicitly frees evicted handles; cache hits do not refresh insertion order. WASM has no separate context cache or numeric-ID registry. Evicted settings are transferred and parsed again if requested, while existing Readers, Builders and pending Reader operations keep their original context snapshot until freed. Disposing `c2pa` terminates the worker and releases its resources. This reuse does not change trust-resource resolution or error handling; see [`c2pa-utilities`'s README](../c2pa-utilities/README.md#trust-resource-fetching) for fetch behavior.
108
+
109
+ A `Context` memoizes successful settings resolution without automatic expiry. Repeated `Reader`/`Builder` calls using that Context reuse its resolution. Create a new `Context` to fetch updated trust resources; the new resolution does not change existing Readers or Builders. Failed resolution rejects and can be retried.
110
+
111
+ The worker acknowledges successful WASM settings registration before subsequent calls omit settings JSON. Failed registration remains retryable; an asset or manifest construction error after successful registration does not discard that registration. An in-flight worker ID that was evicted is recovered by resending its settings once, before construction starts. Native validation and construction errors are not retried or replaced by cache errors.
108
112
 
109
113
  `Context` is defined in `@contentauth/c2pa-utilities` and re-exported unchanged by `@contentauth/c2pa-node`, `@contentauth/c2pa-web` and `@contentauth/c2pa-web/inline`. These entry points share constructor identity and types, including for subclasses. Application bundlers should resolve a single compatible utilities version rather than embedding separate copies.
110
114