您的浏览器已过期。此网站可能无法正常显示。请升级您的浏览器。

Knowledge Base
SEMrush Toolkits
SEO Toolkit
Site Audit
Unminified Javascript and CSS Files

Unminified Javascript and CSS Files Article

Did SEMrush say your site has unminified Javascript and CSS files?

Unminified Javascript and CSS Files image 1What is minification anyway?

Minification is the process of removing unnecessary lines and spaces in the source code of a page. Basically, minified code is streamlined code. This is important because when code is minified it is easier for servers to load the page quickly and easier for search engines to quickly read the content of the page.

When servers can load pages faster, it makes the user experience much better. Less waiting for pages to load means less people leaving your site in frustration. In turn, this improved engagement can also lead to better search engine rankings over time.

How SEMrush checks for unminified files

The SEMrush Site Audit checks a website’s sources that are larger than 1KB and looks for source fragments with whitespace symbols. We identify these source fragments and whitespace symbols as “gaps” in the code that should be minified. If these gaps make up more that 10% of the content, it triggers the issue.

Some additional reasons why this check would be triggered on your site include:

  • Comments inside resources

  • Text files inside JS/CSS resources (for example, localization texts)

  • Large amounts of whitespace (“ “) that do nothing in the code and are there for reading purposes only

Please note that our tool is a harsher critic than even Google at this time. We have reported errors even after a webpage passes Google’s pagespeed test. This is due to the thorough design of our check.

Minification of Javascript files can be done with the tools listed in this Google support article.