OG tags pre-rendering working fine with Netlify domain but not with custom domain

We have our site on Netlify using Netlify’s pre-rendering features because we need to render custom OG images based on the referral URL. This is a referral link:

With Netlify Domain: -> https://felix-fm-dev.netlify.app/tim
With Custom Domain (Namecheap): -> https://felix.fm/tim

Both of these are links of an exact same Netlify project. Pre-rendering of Netflify domain is working fine and showing custom images as it should. But for custom domain, its showing default images. Here are links for Facebook share debugger showing different meta tags for these link:

Netlify Domain: -> https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Ffelix.fm%2Ftim
Custom Domain: -> https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Ffelix-fm-dev.netlify.app%2Ftim

We absolutely love Netlify’s Pre-rendering feature but this issue seems a bit strange because the custom domain is pointing directly at Netlify’s domain.

Any sort of help would be highly appreciated.

Thank You.

Hi, @imhashir. My best guess is that the prerendered URL you are requested is showing a cached version.

We have a prerendering debugging support guide here:

The “Some caveats about the prerender service” says this:

We cache the prerendered content for 24 to 48 hours, so you will want to make sure to test with different URLs each time if you are making changes and republishing a lot while you get things dialed in. Most importantly, this cache is NOT invalidated by a new deploy of your site!

This is my best guess about the reason for what you are seeing. If there are other questions about this, please let us know.

1 Like

It was indeed the cache issue. Got resolved after 24-48 hours.

1 Like