It’s normal for cached JavaScript pages to appear empty, according to Google

According to Google's Search Advocate John Mueller, it's normal for JavaScript-based webpages to appear empty in Google's cached view.

In Google’s cache, JavaScript-based webpages may appear blank or incomplete, which is normal and not indicative of any issues.

In the latest instalment of the Ask Googlebot video series on YouTube, Google’s Search Advocate John Mueller states this.

A user asks why their JavaScript pages aren’t showing up in Google’s cached view.

The question reads:

“The cached version of React pages shows a blank page. What parameters should be considered while coding the React pages with SSR to make them Googlebot friendly?”

A cached page is a snapshot of the URL as it appeared the last time Googlebot crawled it.

When a cached page appears to be empty or lacking content, it’s natural to assume Googlebot encountered a problem while crawling it. However, this isn’t always the case.

Google’s Cache Displays HTML Only

Google’s cache only saves the HTML elements on a page, according to Mueller.

It’s not that Google is incapable of caching JavaScript; rather, browser restrictions prevent Google from doing so.

Caching JavaScript-based webpages is difficult, according to Mueller, because Google’s cache only displays HTML.

Not in terms of technology, but rather in terms of security.

Read Brand Mentions, according to Google’s John Mueller.

Web browsers have limitations on how content can be accessed, and requests for JavaScript files from other websites (such as Google’s cache) may be blocked.

“Google Search sometimes keeps a copy of the HTML page that was fetched from a server and shows that to users in the form of a cached 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.”

While an empty page in Google’s cache may be discouraging, how the page is indexed is what matters most for search.

To be sure, Google can handle JavaScript on its own and will attempt to index the page as it appears to users.

Mueller continues:

“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.”

Use the URL Inspection tool in Search Console to get a more accurate picture of how Google sees your pages.

Learn more from SEO and read Google claims that AI-generated content violates its guidelines.

Exit mobile version