Skip to content

og: drop the og:image sub-properties so Slack renders the card - #38

Merged
itsdangold merged 1 commit into
masterfrom
dang/og-strip-subprops
Sep 18, 2026
Merged

itsdangold merged 1 commit into
masterfrom
dang/og-strip-subprops

Conversation

@itsdangold

Copy link
Copy Markdown
Contributor

Slack resolves the page and shows the title and description, but never the image. Facebook, LinkedIn and opengraph.xyz all render it.

What this changes

Six tags deleted from index.html:

og:image:secure_url  og:image:type  og:image:width
og:image:height      og:image:alt   twitter:image:alt

Before — 12 og/twitter tags, head 2751 bytes
After — 11 og/twitter tags, head 2197 bytes

The remaining set is og:type, og:site_name, og:url, og:title, og:description, og:locale, og:image, and four twitter: tags.

Why

Three pages whose links unfurl in Slack were used as controls: sentry.io/welcome/, blog.sentry.io, and an external site. Between them they rule out every other theory:

Theory Ruled out by How
a missing tag all three ours was a strict superset of all of them
og block must come first sentry.io declares <meta charset> after the whole og block, ~4KB in
comment style blog.sentry.io uses the same short <!-- Open Graph --> labels we do
name= vs property= on twitter tags sentry.io / blog one of each; both work
PNG is the problem external control ships a PNG
245KB is too big blog.sentry.io ships 178KB
missing cache-control blog.sentry.io sends max-age=0, must-revalidate — effectively uncached
a Slack app owns sentry.io unfurls blog.sentry.io sibling subdomain, unfurls fine
Slack's per-URL unfurl cache direct test a URL Slack had never seen also came back imageless

The image itself was also checked and is sound: valid signature, every chunk CRC correct, IHDR 1200x630 depth=8 colourtype=6, not interlaced, 200 to Slack-ImgProxy.

That left exactly one difference. None of the three controls declares any og:image sub-property. This page was the only one that did.

Tradeoff

og:image:alt and twitter:image:alt carried real alt text for screen reader users. That is a genuine loss. But an image Slack will not render has no alt text either — the tags can come back one at a time, each verified against a URL Slack has not seen, once the card is showing.

Not proven

This is the last remaining difference, not a demonstrated mechanism. If the card still does not appear after deploy, the cause is outside the markup and the next thing to look at is the image response, which is unusually bare next to the controls — no cache-control, no etag, no access-control-allow-origin. That is nginx config, not this repo.

tools/README.md records all of the above so the next person does not re-run the elimination.

Slack resolved the page but never showed the image. Every other
explanation is ruled out by three pages whose links do unfurl --
sentry.io/welcome/, blog.sentry.io, and an external control:

  tag completeness   ours was a strict superset of all three
  charset position   sentry.io declares it after the whole og block
  comment style      blog.sentry.io uses the same short labels
  name= vs property= on the twitter tags, both appear and both work
  PNG vs webp        the external control is a PNG
  image size         blog.sentry.io ships 178KB
  cache-control      blog.sentry.io sends max-age=0, must-revalidate
  unfurl cache       a URL Slack had never seen also came back bare

None of those three declares og:image:width, :height, :type,
:secure_url or :alt. This page was the only one that did, which left
it as the sole remaining difference. The head is now the same shape as
blog.sentry.io's, and 2197 bytes rather than 2751.

twitter:image:alt goes with them. The alt text is a real loss for
screen reader users, but an image Slack will not render has no alt
text either; it can come back once the card is showing.
@itsdangold
itsdangold merged commit 9942309 into master Sep 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant