WICG / shared-storage

Explainer for proposed web platform Shared Storage API
Other
85 stars 18 forks source link

Add support for writing from response headers #70

Closed pythagoraskitty closed 1 year ago

pythagoraskitty commented 1 year ago

We propose adding support to write to and delete from Shared Storage via a new HTTP response header Shared-Storage-Write, which will be able to trigger set(), append(), delete(), and clear() operations. This will make our API surface more flexible and thereby provide greater utility to developers. Writing from headers should provide a large performance improvement over creating a cross-origin iframe and writing from there, if a network request is otherwise required.

To use the Shared-Storage-Write response header, the corresponding HTTP request header Shared-Storage-Writable: ?1 must first be sent.

We plan to support making requests with the request header Shared-Storage-Writable: ?1 by way of fetch(<url>, {sharedStorageWritable: true}), as well as a new content/IDL attribute pair sharedstoragewritable/sharedStorageWritable for iframes and images.

jkarlin commented 1 year ago

LGTM but suggest mentioning that this is a large performance improvement over creating a x-origin iframe and writing from there when a network request is otherwise required.

pythagoraskitty commented 1 year ago

I updated both the explainer and the PR description to mention the performance improvement.