Is Netlify pre-rendering working?

Hi,

How can I find out if pre-rendering is working for my web app? Is there a way to view the status of pre-rendering? I enabled it about 2 days ago but google shows it has indexed only one page of the app.

URL: thesaintsofindia.com

Hi @akshay,

Pre-rendering is not going to speed-up Google’s indexing. It’s meant to help, but bears no guarantee. It’s because pre-rendering has no control over how and when Google decides to crawl your website and index it. It depends on a lot of factors. Google might crawl your website but decide to not index it at all.

If you wish to test if pre-rendering is working, you could change your user-agent to the one Googlebot uses. You’d then see the response that Google would see. If you’re not sure how’s it different from your website, you could update a small part of the website. Since pre-rendering is cached for 48 hours, Google won’t see the changes till those 48 hours have passed and it decides to redraw your website.

Hi @hrishikesh ,
I changed the usergent to google bot using an extension. I noticed that the links on https://thesaintsofindia.com/ stopped working. The buttons are working but the links on the images are not working. They are implemented using JS. I am suspecting that could be a prerendering issue.
Can you please help?

Regards

I manually changed my user agent to the official ones provided by Google: Google Crawler (User Agent) Overview | Google Search Central  |  Documentation  |  Google Developers and what I could see is opposite of what you described.

The blog link works as expected and the images load too. The one thing that’s not working is the ‘All quotes’ button. You’ve made that as a link, that is you’re using a <a> tag, but seems like you’re adding a click event listener to it. So that’s not working and it’s not supposed to work.

@hrishikesh I think I am setting the useragent same as you are setting it. Can you click on the image of Swami Vivekananda? That should open his page. It works both on mobile and on desktop/chrome. But when using bot useragent, it does not open any page. Check this: 2021-06-18_15-03-10

As I said, what’s happening is expected. Pre-render readers your page according to JavaScript. It doesn’t execute JavaScript that you’ve added like click-listeners, etc.

For example, React and a few other SSG use JavaScript to render the contents of the <body> based on the URL in the address bar. They don’t generate an index.html for each page, they just generate the home page and handle the rest using JavaScript. So, what pre-render does is, it parses and executes this JavaScript and renders a HTML page which is identical to what your page would look like once the JavaScript is executed. The final result does not rely on JavaScript. Thus, any event listeners, etc. are not preserved. For example:

This is your original page’s card:

You can see a number of event listeners.

However, this is how Googlebot sees it:

No event listeners. No listeners => nothing to handle the click => nothing happens when you click on it.

1 Like