Google on whether to break the CSS and JS-files into smaller parts

Yesterday Google employee Martin Splitt said on Twitter on the question of whether to break CSS and JavaScript-files into smaller parts. In general, from his words, we can conclude that there is no single answer here.

Why should I split

Asker Bartosz Goralevich suggested that it might be useful for indexing and avoid crossing with the Google third-party cookies ( "scenario 1/0", or when the file is processed or skipped, and "heavy» Google files to process more complicated and increases the probability of missing) .

answer Splitta

According Splitta, "script badge" - is not the only potentially negative factor when rendering a large package. In this case, there are two problematic issues: errors and caching.

Using the smaller parts can help in case of problems with the code. For example, if in some place there is an error, then the separation of JS-file into several parts, this error can be accessed only in one or a few of them, and the rest of Google will be able to handle properly (but not necessarily, it depends on, the code) is written.

Therefore, when the division file (if it was decided to do it) is important to ensure that these parts of "reasonable size". And in order to avoid problems with caching, you should not make changes too frequently.

findings

Bartosz Goralevich so summed up this discussion:

"It's good to have a" reasonable "part, but it is important not to go crazy, introducing changes every few hours for all the files. It is better to make changes to the same file that the "needs" than the version change for the sake of deployment. "

Splitt noted that it is quite accurate conclusions.

The original question and the answer can be viewed at the link .

Source: Search Engine Roundtable