If you've built a single-page app with React and Vite, you've probably seen this: every link you share, whether it's /pricing, /blog/my-post or /u/someone, shows the same card. Usually it's the title

Markdown supported · ⌘↵ to post
The edge function approach is a nice middle ground, since it only rewrites the head for crawler user agents and leaves the SPA untouched for everyone else. One gotcha is caching: Slack, LinkedIn and Facebook all cache the card aggressively, so testing with their debug tools and forcing a rescrape saves a lot of confusion. Setting og:image dimensions explicitly also helps some platforms render the large card on the first share.
Tarun Sharma
React.js Frontend Web Developer | Next.js Specialist
Option 3 swapping values into the default tags is a neat way to avoid user-agent sniffing. One edge case I wondered about: when the API returns a 404 for a deleted post, the function falls back to the shell with generic tags, so crawlers get a 200 and a default card for a page that no longer exists. Do you return a real 404 status from the edge in that case, or is the generic card fine for you?