You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, static assets uploaded to Workers for Platforms are associated with the User Worker they are attached to. However, if multiple User Workers exist under the same account, assets with identical hashes may be shared across them.
62
+
63
+
If strict isolation between User Workers is required, we recommend:
64
+
65
+
-**Prefixing asset hashes** with an account-specific or worker-specific identifier to ensure uniqueness.
66
+
-**Ensuring JWT tokens for asset uploads are only issued to trusted platform services**, and not directly exposed to end-users.
67
+
-**Explicitly documenting asset-sharing expectations** for your customers if cross-project asset reuse is intended.
68
+
66
69
</Aside>
67
70
68
71
#### Example manifest (JSON)
@@ -135,6 +138,14 @@ If the response to the Upload Session API returns `buckets`, that means you have
135
138
136
139
Use the [Workers Assets Upload API](https://developers.cloudflare.com/api/resources/workers/subresources/assets/subresources/upload/) to transmit the raw file bytes in base64-encoded format for any missing or changed files. Once uploaded, Cloudflare will store these files so they can then be attached to a User Worker.
137
140
141
+
<Asidetype="caution">
142
+
Cloudflare automatically de-duplicates identical asset hashes within the same
143
+
account. If an asset with the same hash has already been uploaded, it may be
144
+
shared across different User Workers unless **explicitly made unique**. If you
145
+
require full asset isolation, prepend asset hashes with a unique identifier
146
+
(for example, an account ID or Worker name).
147
+
</Aside>
148
+
138
149
#### API Request Authentication
139
150
140
151
Unlike most Cloudflare API calls that use an account-wide API token in the Authorization header, uploading file contents requires using the short-lived JWT token returned in the `jwt` field of the `assets-upload-session` response.
0 commit comments