Should we delay changing the meta tags after a user navigates to a new page in an SPA for SEO reasons?

Viewed 19

SPA uses window.history.pushState for changing URL and navigating to another page. Do search engine crawlers check the page content (eg. title, meta tags, body) again?

Suppose I am changing meta tags and title after navigating to different page. We could consider adding a few seconds delay for fetching information from the server before updating title or meta tags (however the navigation will happen by that time)

Would this method help search engines index our site better?

1 Answers

You do not need to introduce a delay for page updates when a user navigates. Googlebot and users don't navigate between pages in the same way.

Users click between pages. The content loads without a full page reload. You use pushState to update the URL.

Googlebot never simulates any user interaction with the page, including clicking. Googlebot scans the document object model (DOM) and looks for links. It records the href from those links into its crawl queue. It will then later reload your entire SPA starting from each of those other URLs.

Introducing a delay would just hurt the usability of your site without doing anything for search engine crawlers.

For crawlers you need to make sure that you render <a href=...> navigation elements and that your SPA loads correctly with the correct content for the URL if you paste any of its URLs into your browser's URL bar.

For a more comprehensive list of all the things you need to pay attention to when using client-side rendering with Google for SEO, see: Do search engines perform JS rendering while crawling? - Webmasters Stack Exchange

Related