Why doesn’t my JS page get cached in Google?

Search Engine Optimization

Why doesn’t my JS page get cached in Google?

05/14/2022 12:00 AM by TheChiefHustler in

As JavaScript includes numerous capabilities that transform the web into a strong application platform, it is an essential aspect of the web platform. Making your JavaScript-powered web apps searchable on Google can help you attract new users and re-engage existing ones as they look for the material your app delivers. While Google Search uses an evergreen edition of Chromium to run JavaScript, there are a few things you can do to improve the performance.

In the recent episode of #AskGoogleBot, John Mueller answers a question shared by Mr Ankit Gupta (@ankiitGuptaSEO):

This is a typical question that many people have. Many people are frustrated because the cached version of React pages is blank, and they want to know what criteria should be addressed while designing React pages with SSR to make them Googlebot friendly.

The Answer:

Google search occasionally saves a duplicate of the HTML page that was obtained from a server and displays it to users as a cache page. However, that is only the HTML page. It gets a little tricky for a JavaScript-based website here. There are limitations on how content can be accessed from a page due to browser security.

If a page requires the JavaScript file from your server, for example, your browser may refuse the request if it originates from another website. The other website in our situation would be Google's cache. In practice, this implies that when JavaScript websites are displayed from the Google cache, they frequently display an empty or partial page. This is completely typical and does not indicate a concern. For indexing purposes, Google will process JavaScript separately and attempt to index the content that a visitor would view if they visited your page directly.

If you wish to double-check, the rendered version of a page is viewable in the Google search console's testing tools. Google can render and index content on Javascript-based websites in most cases. In short, it's typical for a JavaScript website's cache view to be empty or incomplete. It's not a sign of a problem; it's simply a result of browser limitations.

Use cache that lasts a long time.

To decrease network queries and resource use, Googlebot caches aggressively. Caching headers may be ignored by WRS. As a result, it's possible that WRS will employ out-of-date JavaScript or CSS resources. By creating a fingerprint of the content section of the filename, such as main.2bb85551.js, content fingerprinting solves this difficulty. Because the fingerprint is determined by the file's content, each update results in a new filename.

Wrapping Up

We hope this clarifies things for you. Stay connected for the most up-to-date information on the SEO industry, as well as a variety of digital marketing tips and tactics.


leave a comment
Please post your comments here.