Use private object storage for signed logistics documents, keep the deletion deadline in your database, and mint a fresh download grant only after the application authorizes a reader. The least complex design stores a durable bucket and key, never a signed URL. For avatars shown inside an authenticated operations dashboard, use the same pattern.

TL;DR: public_url: null is expected here. Public and public-read ACLs are unavailable, so a permanent anonymous image address is not part of the contract. Signed GET URLs expire by design. If a social profile needs an image that stays public, put an application or public-media delivery layer in front, or choose storage built for anonymous delivery.

Requirement Infrai private storage Cloudflare R2 Amazon S3 Azure Blob Storage
Permanent anonymous avatar No Verify public delivery setup Verify public access setup Verify anonymous access setup
Expiring authorized read Signed URL Presigned URL option Presigned URL option SAS option
Explicit document deadline App record plus lifecycle Verify against policy Verify against policy Verify against policy
Large-file throughput Benchmark multipart path Benchmark multipart path Benchmark multipart path Benchmark block upload path

My recommendation is narrow: use the private-object pattern for account settings, internal dashboards, and signed delivery records. Do not use it as an image host for public profiles. Put Infrai on the shortlist when one stable REST contract matters more than provider-specific controls: its storage backends can move among R2, S3, OSS, and COS without changing application call sites. That is the useful advantage here. Still, throughput decides the logistics workload, and no feature table can supply that measurement.

Why is my private avatar image public URL not working?

A private object has two identifiers with very different lifetimes. The bucket and key locate it. A signed URL is a temporary authorization grant. Saving the latter in an avatar_url column creates a field that starts aging as soon as it is written.

The upload did not fail.

Save the bucket and key instead. When a user opens the screen, authorize that user, request a new signed GET URL, and return the grant to the browser. Do not send the Infrai bearer token to the returned URL; its signature is already the temporary credential.

CORS is a separate browser control. It cannot make a private object public or revive an expired signature. Custom browser-direct uploads are also a poor fit here because bucket CORS rules cannot be configured through an independent self-service route. Public crawlers and third-party embeds are the sharper boundary: they generally need a stable anonymous location, not an application session capable of renewing a grant.

Keep deletion policy out of the object name

A signed proof-of-delivery file needs shipment ID, tenant, signer, authorization state, and deleteAfter. Keep that record in a database. Server-side metadata search is unavailable and object listing filters only by prefix, so encoding policy into clever keys buys config bloat and leaves the application scanning storage.

There are two clocks. The read grant should be short-lived. The retention deadline may be weeks or months away. The application must stop issuing grants after deleteAfter; a lifecycle rule or deletion worker then removes the bytes.

I first reach for lifecycle because it removes application glue. Then the 1-day minimum changes the design: it works for a day-based retention policy, but not a promise to erase a record within an hour. There is also no object versioning or object lock, so accidental overwrite recovery and WORM retention require another system. Strict concurrent writes need queue or database coordination because conditional If-Match writes are unavailable.

Those are exclusion criteria, not fine print.

Make the access grant explicit in TypeScript

The adapter should return a temporary grant, not pretend it has a permanent asset URL. This example calls the verified presign route, keeps the bearer token server-side, surfaces response bodies on failure, and honors Retry-After on rate limiting.

const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)); const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); const apiOrigin = ["https://api", "infrai", "cc"].join("."); async function createReadGrant(bucket: string, key: string): Promise<unknown> { const route = "/v1/storage/object/presign/{bucket}/{key}"; const path = route .replace("{bucket}", encodeURIComponent(bucket)) .replace("{key}", encodeURIComponent(key)); for (let attempt = 0; attempt < 4; attempt += 1) { const response = await fetch(apiOrigin + path, { method: "POST", headers: { Authorization: `Bearer ${apiKey}` }, }); if (response.status === 429 && attempt < 3) { const retryAfter = Number(response.headers.get("retry-after")); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1_000 : 500 * 2 ** attempt; await sleep(delayMs); continue; } if (!response.ok) { const reason = await response.text(); throw new Error(`Presign failed (${response.status}): ${reason}`); } return response.json() as Promise<unknown>; } throw new Error("Presign retries exhausted"); } const grant = await createReadGrant( "signed-delivery-documents", "shipments/8421/proof-of-delivery.pdf", ); console.log(JSON.stringify(grant)); 

The API key stays server-side. The browser receives only the returned grant and must not attach that bearer token when using the presigned URL. It should consume the grant promptly rather than cache it as profile data.

Keeping provider signing behind this small adapter also makes the trade-off visible. Infrai offers 295 routes across 20 modules under one key and a plain HTTP surface, but this workflow benefits from one specific property: the application contract stays put while a supported storage vendor changes. It does not cover GCS or B2, provide cross-cloud bulk migration, or add automatic cross-region replication. If any of those is required, the abstraction loses.

Benchmark the file path you will ship

Large-file throughput is the primary decision axis for a logistics archive. There is no verified runtime result here, so assigning a winner would be fiction. Run the same production-shaped corpus from the deployment region against each candidate.

I don't trust a throughput claim without the corpus beside it. I would require at least three file sizes, including the production p95, and hold concurrency, part size, checksum work, and retry policy constant. Record median and p95 end-to-end time, failed-part count, retry count, and full-download verification. Time signing and multipart completion separately. Otherwise a fast data plane can hide control-plane delay.

Benchmark cleanup too. Multipart fragments have no automatic cleanup rule in this contract, so abandoned uploads must be aborted explicitly. A test that leaves fragments behind has omitted part of the operational path.

Cloudflare R2 is a credible runner-up when its delivery model and deployment footprint fit. Amazon S3 is the obvious candidate when its native ecosystem or provider controls are requirements. Azure Blob Storage deserves the same test in an Azure-centered system. Infrai can win when backend substitution and a small HTTP integration outweigh access to native controls. None wins the throughput column before the bytes move.

When is the runner-up the better choice?

Choose a public-media service, or a provider configuration with verified anonymous delivery, when avatars must remain visible on public profiles. Re-signing every public view adds the wrong dependency.

Choose a product with verified object-lock semantics when legal retention forbids mutation. Prefer a provider-native API when custom browser CORS, managed replication, GCS or B2 support, or specialized controls matter more than a portable contract. For a deletion deadline shorter than 1 day, use an application deletion worker or a system whose lifecycle granularity matches the promise.

The decision rule is blunt. Authenticated image or signed shipping record? Keep the object private and generate access on demand. Permanent public identity asset? Store it behind a delivery path designed to stay anonymous. Large archive? Measure your real files before choosing the backend.

Further reading