Docs & Code Guide

Share diagrams in Slack: unfurl mechanics, the cache, and cache-busting

Slack is where architecture questions actually get asked, so a diagram URL that unfurls into the conversation answers them where they happen. The mechanics have two layers worth understanding: how Slack decides to render your URL inline, and how its unfurl cache decides which version of the image people see. Get both right and a freshly regenerated diagram lands in the channel looking current, instead of resurrecting last month's architecture.

6 min readFor engineers who answer architecture questions in Slack threads

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

169/20003 credits left
Try:

No account needed · Editable canvas, not a picture

How Slack decides to show your image

Paste a URL and Slack fetches it to build an unfurl. A URL that responds with an image Content-Type renders inline as the image itself; an HTML page renders as a link card built from its Open Graph tags, og:image included. A direct image URL is therefore the strongest form for a diagram: the picture lands in the thread full-size, no card chrome around it.

The Datadef image URL responds as a PNG by default, so it unfurls as the diagram. The interactive page URL unfurls as a card instead; it earns its place when you want readers clicking through to pan and zoom, and the two can travel together in one message.

Unfurls as the image itself:
https://datadef.io/api/embed/my-platform-a1b2c3d4

Unfurls as a link card; click through for pan and zoom:
https://datadef.io/embed/my-platform-a1b2c3d4

The unfurl cache, and why old messages stay old

Slack caches unfurl results per URL, roughly half an hour globally, and proxies the images themselves through its own image proxy with its own cache. There is no API to purge either one. The consequences are specific: repost the same URL right after regenerating the diagram and Slack may serve the cached unfurl; and messages posted earlier keep the preview they were born with, because Slack does not retroactively re-render unfurls in old messages.

For a diagram this is a real correctness issue. The thread from three weeks ago shows the architecture of three weeks ago, with nothing marking it as outdated. Treat Slack previews as timestamped by their message, and when a thread resurfaces after an architecture change, post the URL again rather than pointing at the old message.

Busting the cache with a versioned URL

The reliable workaround is making the URL unique when you need a fresh render: append a throwaway query parameter and Slack treats it as a URL it has never seen, fetching and unfurling from scratch. Editing the message containing the link also makes Slack re-process that message's unfurl.

This composes well with regeneration. When an agent updates the diagram after a merge, have it post the announcement with a version parameter, the merge SHA is the natural choice. Every such message then unfurls the diagram as of that merge, and the channel history becomes a visual changelog of the architecture.

Force a fresh unfurl by making the URL unique:
https://datadef.io/api/embed/my-platform-a1b2c3d4?v=a1f39c2

The extra parameter is ignored by the renderer; it exists so
Slack's cache sees a brand-new URL.

App unfurl domains, for teams building Slack apps

One layer deeper: a Slack app can register unfurl domains and subscribe to link_shared events, letting it attach custom unfurls when links from those domains are posted. That is how internal tools decorate their links with rich context. It is not required for anything in this guide, image URLs and OG cards unfurl without any app, but teams already running a Slack bot can use it to enrich diagram links with, say, the last-updated time.

Slack is the conversation, not the documentation

A diagram unfurled in a thread answers today's question and then scrolls away, becoming exactly the kind of buried knowledge that tribal knowledge in engineering teams describes. The pattern that works: docs pages carry the live embed as the permanent home, Slack carries the URL when the question comes up, and the URL always resolves to the current diagram.

The source diagram stays current the same way everywhere the URL travels: a person edits it, or an agent does. Datadef exposes diagram tools through its MCP server, registry name io.datadef/mcp, so the redraw can ride the same merge that changed the architecture, and the next unfurl of the URL shows it. Detection is not part of the offer, Datadef never watches a repository; the agent call is the trigger, gated by an API key that arrives with a paid plan. The URLs exist only for projects shared public, so confidential architectures should travel through Slack as uploaded files instead, staleness accepted.

FAQ

Why does my diagram URL show an old image in Slack?

Slack caches unfurl results per URL for roughly half an hour and proxies images through its own cache, with no purge API. Append a throwaway query parameter such as ?v=2 to make the URL unique and force a fresh unfurl, or edit the message containing the link.

How do I make an image URL unfurl inline in Slack?

The URL must respond with an image Content-Type; Slack then renders the image itself in the message rather than a link card. A URL serving an HTML page unfurls as a card using its Open Graph tags instead.

Do old Slack messages update when the diagram changes?

No. Unfurls are rendered when the message is posted and are not retroactively refreshed, so an old thread keeps showing the diagram as it was then. When an architecture discussion resurfaces, post the URL again to get a current unfurl.

What are Slack app unfurl domains?

A Slack app can register domains and subscribe to link_shared events, then attach custom unfurls when links from those domains are posted. It enables rich custom previews from a bot; plain image URLs and Open Graph cards unfurl fine without any app.

Should Slack be where our architecture diagram lives?

No, Slack is where it gets referenced. Threads scroll away and their previews freeze at post time. Keep the live diagram embedded in a docs page or wiki as the permanent home, and share the URL in Slack when questions come up; it always resolves to the current version.