One SEO professional asked John Mueller in a submitted question in Ask Googlebot about why their JavaScript framework pages are not being shown in Google’s cache view.
John explained that Google search sometimes keeps a copy of the HTML page that was fetched from the server, and this is what’s shown to users in the form of a cache page.
That is, however, really just the HTML page. For JavaScript-based websites, this gets a bit complicated.
Because of browser security, there are restrictions on how content can be accessed from a page.
For example, if a page needs a JavaScript file from the server, then browsers could block that request when it comes from other websites.
In Google’s case, the other website could be Google’s cache. In practice, this means that JavaScript based websites will often show an empty or an incomplete page when they are shown from Google’s cache.
This is normal and not a sign of a problem.
For indexing, Google will normally process the JavaScript separately and try to index what a user would see when they visit the website directly.
This rendered version of a page will be visible in Google Search Console’s testing tools, if an SEO professional would like to double-check.
For the most part, however, Google can render and index content on JavaScript websites just fine.
In short, it’s normal that the cache view of a JavaScript site is empty or incomplete.
John Mueller AskGooglebot Transcript
John (Submitted Question)
Hey. Now we have a question from Ankiit Gupta coming in from Twitter. Ankiit asks why their JavaScript framework pages aren’t shown in Google’s cached view?
John (Answer)
Well, thank you for asking Ankiit. Google Search sometimes keeps a copy of the HTML page that was fetched from the server and shows that to users in the form of a cache page. That is, however, really just the HTML page. For JavaScript based websites, it gets a little bit complicated here. Because of browser security, there are restrictions on how content can be accessed from a page.
For example, if a page needs a JavaScript file from your server, browsers may block that request when it comes from other websites. In our case, the other website would be Google’s cache. In practice, this means JavaScript based websites often show an empty or an incomplete page when they’re shown from Google’s cache.
This is normal and not a sign of a problem. In particular, for indexing, Google will process the JavaScript separately and try to index what a user would see when they visit your website directly. This rendered version of a page is visible in Google Search Console’s testing tools if you want to double check.
For the most part, Google can render and index content on JavaScript based websites fine. So in short, it’s normal that the cache view of a JavaScript website is empty or incomplete. That’s not an indication of a problem, it’s just a technical restriction in browsers.
Well, Ankiit, I hope that helps to clear things up. If there are any other questions on your mind, please drop us a note with the hashtag AskGooglebot.