From 12ce0ed7af073e3ae06adb7f3624fc227d0b6d26 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Sat, 11 Apr 2026 17:14:31 -0500 Subject: [PATCH] add BUD-14 for blob previews via Link headers --- README.md | 1 + buds/14.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 buds/14.md diff --git a/README.md b/README.md index 23c4615..5d85cce 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ BUDs or **Blossom Upgrade Documents** are short documents that outline an additi - [BUD-09: Blob Report](./buds/09.md) - [BUD-10: Blossom URI Schema](./buds/10.md) - [BUD-11: Nostr Authorization](./buds/11.md) +- [BUD-14: Blob Previews](./buds/14.md) ## Endpoints diff --git a/buds/14.md b/buds/14.md new file mode 100644 index 0000000..29f88ee --- /dev/null +++ b/buds/14.md @@ -0,0 +1,50 @@ +# BUD-14 + +## Blob Previews + +`draft` `optional` + +Defines how Blossom servers can advertise preview images for blobs using the HTTP `Link` response header as specified by [RFC 8288](https://www.rfc-editor.org/rfc/rfc8288.html). + +## Preview discovery + +On successful `HEAD /` and `GET /` responses, servers MAY include a `Link` response header with `rel="preview"` to advertise a preview representation of the blob. + +Example: + +```http +HEAD /b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf HTTP/1.1 + +HTTP/1.1 200 OK +Content-Type: application/pdf +Content-Length: 184292 +Link: ; rel="preview" +``` + +The link target MAY be an absolute URL or a relative reference resolved according to [RFC 8288](https://www.rfc-editor.org/rfc/rfc8288.html). + +## Preview representation + +The link target identifies a preview representation of the blob. + +The preview representation SHOULD be returned as an `image/*` resource. + +The preview URL is implementation-defined and is not required to be a Blossom blob URL or any other [BUD-01](./01.md) endpoint. + +Servers MAY generate previews eagerly, lazily, or on demand. + +Servers MAY omit the `Link` header when no preview is available. + +## Client behavior + +Clients SHOULD use `HEAD /` to discover previews without downloading the original blob. + +Clients MAY also inspect `GET /` responses for the same `Link` header. + +Clients MUST NOT assume the preview URL can be derived from the blob URL. + +Clients SHOULD treat the preview as an optional hint and fall back gracefully when the `Link` header is absent or the preview resource cannot be fetched. + +## Notes + +Servers MAY also expose the same preview URL using the NIP-94 `thumb` tag described in [BUD-08](./08.md).