Summary

  • RFC 2397, August 1998, noticed that some applications "have a need to embed (small) media type data directly inline" and handed them a scheme that works like "immediate addressing".
  • The grammar is data:[<mediatype>][;base64],<data>. Leave the media type out and it "defaults to text/plain;charset=US-ASCII".
  • The RFC is honest about the ceiling: the scheme "is only useful for short values", and the HTML of the day capped a single anchor at 1024 characters.

The pointer that turns up carrying the parcel

Every ordinary URL is a promise to go and fetch something. A data URL has already been. Address and payload are one string, which sounds like a small grammatical trick until you notice it rewrites every property an identifier is supposed to have.

A pointer can rot from underneath you; a parcel cannot — it is either in your hand or it is not. A pointer can be cached by anyone holding the address; a parcel has to be re-sent, re-encoded, re-stored. A pointer names one thing for as long as the thing exists; a parcel names itself only until somebody re-encodes the same bytes with a different line break.

One icon, a thousand names

Line breaks, percent-escapes and base64 padding are all legal, so a single small image has an unbounded family of valid data URLs and no way to declare which one is the real one.

Everything downstream that compares URLs as strings — caches, analytics, allowlists, deduplication, your own logs — sees a different identifier for identical bytes. That is the bill for putting data where the identity used to be. You did not just inline the content; you inlined a fresh identity along with it.

No relatives, no updates

The scheme "has no relative URL forms", which is obvious the moment you say it out loud: a document folded inside a document has nothing left to be relative to.

Updating is stranger still. A data URL cannot be refreshed in place. To change the content you change the reference, and then every copy of the reference has to change too — a distributed-systems problem wearing a URL's clothes.

The length limits were doing the design work

The draft pointed at HTML's own ceilings — a 2100-character tag, a 1024-character anchor literal — and let them pick the use case. Those numbers, not any principle, quietly ruled that data URLs were for favicons, tiny style fragments and short notes.

Browsers later raised the limits and then restricted data URLs again for security, because content that arrives with its own type and no fetch has no origin to blame. A payload with no provenance is a payload with nobody to hold responsible.

What self-containment actually costs

An identifier that contains its referent trades the cost of fetching for the cost of comparing. Sometimes that is a bargain: a favicon fetched once per page view is a round trip saved a thousand times, and nobody needs to diff two copies of a 4KB icon.

The bargain sours on three conditions — when the content is large, when it changes, and when trust depends on where it came from. All three eventually turned up, and all three are arguments for a pointer.

The lesson, which is not really about URLs

Immediate addressing is a real design option, not a hack. It is the right choice exactly when the round trip costs more than the redundancy.

But every indirection you delete was quietly providing something: a place to cache, a thing to compare, a handle to update, an origin to trust. Remove it and those properties do not migrate into your new design — they leave. So before you inline the answer into the question, write down what the middle layer was doing for you. It was doing more than you noticed.