1

I've minified all of my Js and Css scripts and stylesheets, respectively, but deployed them on my site as .js and .css files, respectively. A colleague now told me that it's better to store their names using the .min prefix, as this will be processed differently by the browser, and for example Google will improve the ranking of your page, as it will assume faster page load times.

I cannot find anything online is this sense; so I wanted to ask here: Is this actually true?

DevelJoe
  • 856
  • 1
  • 10
  • 24
  • 3
    *"A colleague now told me that it's better to store their names using the .min prefix, as this will be processed differently by the browser..."* That is incorrect. *"...and for example Google will improve the ranking of your page, as it will assume faster page load times."* I very, very much doubt that. Google will look at the size of the resources, not their names. Having `.min` in the names may be useful for humans, but I don't think browser developers or Google search devs are stupid enough to make assumptions based on it being there. – T.J. Crowder Jan 08 '22 at 13:37
  • See this link please : https://stackoverflow.com/questions/31690045/what-are-the-advantages-of-minified-javascript-code – Keyvan Soleimani Jan 08 '22 at 13:38
  • 1
    It seems to me this question should be closed, but for the life of me I can't figure out what close reason is appropriate. :-) – T.J. Crowder Jan 08 '22 at 13:38
  • 1
    To expand on what T.J. Crowder said, if Google gave preference to pages based on naming files this way, everyone would be doing it. The fact that this is not the case should also answer your question. – Etheryte Jan 08 '22 at 13:40
  • 1
    @T.J.Crowder yeh I thought the same, but it sounded interesting to me, especially the Google thing, although you could then pretty easily obtain fake ranking points. In my opinion, the ```.min``` file extension is a pure naming convention. So that's correct right? There's 0 functional difference in between storing uglified code as ```.js``` and ```.min.js```? – DevelJoe Jan 08 '22 at 13:40
  • 1
    @Etheryte haha yes completely agreed, which is why it sounded weird to me anyway. – DevelJoe Jan 08 '22 at 13:41
  • 1
    @DevelJoe - Yes, I'm sure both claims are nonsense. But rather than saying that to him, I would just ask him to provide citations for the claims. When he can't, or he can only provide "citations" that are just other people making the claim without evidence, there you go. – T.J. Crowder Jan 08 '22 at 13:43
  • aight, cheers to all! – DevelJoe Jan 08 '22 at 13:44

2 Answers2

4

.min.js is a standard used for "minified" versions of a JavaScript file.

Google doesn't cares about whether the file itself contains ".min.js" but creating a minified version of the script greatly reduces the size of the file which then reduces the bandwidth required to load the page. This is what Google cares about for its rankings.

Josh Ackland
  • 603
  • 4
  • 19
0

Google will not parse differently if the minified version is used. But using minified will have advantages on your application.

  • It will drastically reduce loading times and bandwidth usage on your website.
  • It also improves site speed and accessibility, directly translating into a better user experience.

For example:

jquery.min.js: this is the minified version of jQuery. I.e. .min.js

jquery.js: this is the regular version of jQuery.

Basically the functionality is exactly the same except the readability hence better use minified version in your PROD environment and keep regular version for debugging purposes.

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51