Commit 1b1b77a
fix(app): serve the OG image as an opaque PNG at a fresh URL
Twitter/X was rendering no preview for devbar.sh even though the page and
image both check out server-side: the crawler gets 200s for the HTML and the
image, the SPA rewrite does not swallow it, and robots.txt allows it. Two
things left that X is known to trip on.
The image was RGBA. Every pixel was fully opaque, but canvas toDataURL always
emits an alpha channel and X is unreliable with alpha PNGs. The generator now
reads raw pixels off the canvas and encodes the PNG here as truecolor (color
type 2, no alpha) using node:zlib, so no new dependency. Output is pixel
identical and drops from 165 KB to 90 KB.
X also caches card data per URL for about a week, negative results included,
and there is no public validator left to purge it. Bumping to og-v3.png gives
crawlers a URL they have never resolved. og.png and og-v2.png redirect to it,
and it now carries an immutable long-lived Cache-Control.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aryuPfj68QeQdMmsQuTBy1 parent dd4274b commit 1b1b77a
6 files changed
Lines changed: 85 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
Binary file not shown.
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | | - | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
23 | 83 | | |
24 | 84 | | |
25 | 85 | | |
| |||
31 | 91 | | |
32 | 92 | | |
33 | 93 | | |
34 | | - | |
| 94 | + | |
35 | 95 | | |
36 | 96 | | |
37 | 97 | | |
| |||
44 | 104 | | |
45 | 105 | | |
46 | 106 | | |
47 | | - | |
| 107 | + | |
48 | 108 | | |
49 | 109 | | |
50 | 110 | | |
51 | 111 | | |
52 | 112 | | |
53 | 113 | | |
54 | 114 | | |
55 | | - | |
| 115 | + | |
56 | 116 | | |
57 | | - | |
| 117 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
0 commit comments