Support » Plugin: SG Optimizer » Leaving unminified JavaScript & CSS on server

  • Resolved XyZed

    (@xyzed)


    Hello. This is an unusual one. I just signed up to semrush for a free trial, and after spidering my site SEMrush has warned me that over 5000 JavaScript and CSS files are NOT minified. This is despite me having them minified using SG optimiser.

    I’ve exchanged several emails with SEMrush but unfortunately they seem more interested in defending their warning, which I, after initial concern and investigation believe to be erroneous and unnecessary.

    It seems that when SG optimiser minifies JavaScript and CSS files it leaves them all on the server, but creates duplicate copies with an identifying “.min” appended to the file extension. e.g.-

    responsive-menus.js
    responsive-menus.min.js

    If you open the first file it is the original file full of spaces. But if you open the second file there is a notice saying this file is auto-generated. The contents are then displayed all on one line.

    Now I know my website is very well minified because I score 99 on Google’s page speed page (desktop). The problem is I’ve been essentially arguing with support at SEMrush who keep insisting that the warnings are perfectly valid, and I have thousands of unminified JavaScript and CSS files on my site, which they claim is potentially damaging. They’ve even said that Google will see them when it crawls.

    My position has been that surely Google doesn’t remotely care about unminified files and is only crawling files looking for content to display in Serps? And surely Google only does its page speed test by actually rendering pages, which SG optimiser ensures are all served using the minified files?

    However, they have been quite insistent that their tool is right to warn me of these files and warn me they are unminified even those far as I can see they are never actually used whilst ever minification is selected on SG optimiser? But it’s got me thinking I should at least doublecheck?

    Andy

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Indeed, Google doesn’t care if a script is minified or not as a direct criteria. Google cares about speed and minification has affect on that.

    As a rule, we do not minify files that have *min* in them because such files are already minified by a third party script – either a theme or a plugin. The files modified by us are moved to the uploads folder / siteground-optimizer-assets named oroginal-file-name.min.js.

    In addition to that, we don’t minify external resources.

    If I were you, I would just open the files reported by SEMrush direcctly and check if they are minified. If they are – just tell them to fix their checkers because that would mean that they fail to detect properly minified content. If not, check why that script is not minified depending on what’s the script and how it’s named.

    Anyway, I wouldn’t bother with that too much if you already have a fast loading site and such a great score at PageSpeed.

    Thread Starter XyZed

    (@xyzed)

    Hi Hristo. Thank you for your reply. So the duplicate minimised files are not SG optimizer’s? I had assumed that they were because I am using SG optimiser to minify JavaScript and CSS files. So the duplicate files must be from WP rocket who I have previously used for minifying files that changed over to SG optimiser.

    I checked the uploads folder / siteground-optimizer-assets and was surprised to see there are only 9 JavaScript files and no CSS files. Is this normal? I would have expected to see all of my JavaScript and CSS files minified there?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Leaving unminified JavaScript & CSS on server’ is closed to new replies.