Menu

Content-Hashed Share Image Filenames: Helping Chat Apps Fetch Your New og:image (A Tested Node Build Step)
📰

Content-Hashed Share Image Filenames: Helping Chat Apps Fetch Your New og:image (A Tested Node Build Step)

DEV Community: node·Abid Ali·5 days ago
#7wcYHOuk
#devtonodejs#devto#dev#const#await
Reading 0:00
15s threshold

Here is a support message I have answered more than once: "I replaced the share image on the pricing page last week. Slack shows the new one. LinkedIn shows the new one after I asked it to re-read the page. But some other card still has the old picture, and so does the CDN when I open the image directly from another network."

The page was fine. The tags were fine. The problem was the file name. The site had a single og-pricing.png that the client overwrote whenever the design changed, and every layer between the server and the chat app had a reason to hold on to the old bytes for that exact URL: the CDN, the browser cache of whoever opened it, and the image proxies some apps put in front of share images.

The fix I now ship on static sites is boring and reliable: never change the bytes behind a share image URL. When the picture changes, the URL changes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.