blog posts

Tutorial on how to fix the Minify JavaScript and CSS error in YSlow GTmetrix

One common error when testing site speed with GTmetrix is ​​called Minify JavaScript and CSS, which is displayed in the Yslow header. Of course, this error is also displayed in Page Speed, which is related to Google. This error in GT Matrix indicates that the CSS and JS files are not well optimized and compressed. To fix this error, you should find the style and JavaScript files identified by the Yslow column of GT Matrix and considered as non-optimal files and compress them with the help of coding, online tools or plugins and plugins of your site builder system. make it

This tutorial from Hostfa’s knowledge base will discuss how to fix the Minify JavaScript and CSS error in GT Matrix. Using this tutorial, you can compress the JS and CSS files on the site and increase the speed of your site. So, if you also encounter this GT Matrix error, stay with us until the end.

Training on how to fix the Minify JavaScript and CSS error in Yslow JT Matrix

As I mentioned above, what you need to do to solve the Minify JavaScript and CSS problem in Yslow GT Matrix is ​​to find the identified files and compress the files using the tool you have. Previously, in the article on how to fix the Minify JavaScript error in GTmetrix and the tutorial on how to fix the Minify CSS error in GTmetrix how to fix these errors that were in the page speed column, and you just need to use these solutions to fix this error for the Yslow column. Do.

Fixed Minify JavaScript and CSS error in YSlow GT metrics

Fixed Minify JavaScript error in Yslow JT metrics

If the files displayed in the Yslow tab of GT Matrix and the Minify JavaScript and CSS section are in JS format. If there are, you should try to fix the error in the following ways.

1. Using the GTmetrix site

If you go back to the site speed test page in GTmetrix and search for Minify javascript using the combination keys CTRL + F, after clicking on this option, you will see which files are not optimized, similar to the image below.

Fixed Minify JavaScript and CSS error in YSlow GT metrics

If you pay attention, at the end of the address of each CSS file, there is an Optimized Version, by clicking on this phrase, you can download the optimized and compressed version of the same JS file. You only have to log in to your host after downloading the file and click on the File Manager option. Then, based on the file address, refer to the path related to this file in public_html and replace the downloaded file with the previous JS file. In addition, the compression rate of each file is also included, which can encourage you to optimize the JS file.

2. Use an online JS compression tool

In this way, you can optimize your codes using online sites that provide tools for compressing programming files. For this purpose, click on the button below to be directed to the page of the desired site.

minifycode.com

After entering this site, just copy your javascript code like the image below and put it in the box of this site.

Fixed Minify JavaScript and CSS error in YSlow GT metrics

After placing the codes, click on the Minify Javascript button; your codes will be prepared in a compressed form and will be shown to you like the example below, by replacing them in the JS file, you can remove empty spaces and non-useful description codes, and also from the volume Reduce the file.

Fixed Minify JavaScript and CSS error in YSlow GT metrics

3. Minify javascript for dynamic sites

In this case, your site is designed using CMS and site builders, you have a database and must use compression plugins. For this purpose, various plugins have been created, each of which gives you special features and facilities. But for this, I suggest you use a plugin that provides you with more features so that you can compress other files such as CSS and HTML in addition to minifying WordPress javascript. Until today, I have introduced several plugins in the Hostfa knowledge base for this purpose. You can learn about and use these plugins by referring to the articles on how to install the wp rocket plugin to increase the speed of the site and training on compressing files in WordPress and increasing the speed of the site