• Resolved wpmhweb

    (@wppit)


    I’ve trying to set up JS minify W3TC, but I’m having problems.
    I’m currently loading on the website ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js because I have serveral features that depends on it. However, it’s the only js file that is causing the biggest render blocking. When I enable JS minify auto or manually, I get errors like “Uncaught TypeError is not a function,” and other Uncaught errors for features that depend on this JS. I have using defer or async, change the order of the js file, placing it on head, body, or /body, but the problem continues.
    I have also try removing the features that are causing the problem, but then another conflict appears, but with other features that wasn’t causing problems before.
    If I don’t include the 1.7.2 js, I don’t see the problem, but the point of using minify was to remove this rendering blocking using this JS.
    Is there anything else I can do to fix this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    Thank you for your inquiry and I am happy to assist you with this.
    The ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js is the Google Hosted Library, meaning it comes from a server other than yours.
    This means that W3TC cannot handle that file or when it attempts to do something about it breaks the functionality. As you can see it contains jquery.min.js which means that the file is already minified.
    So the solution is either to remove that file (stop it from loading) or exclude the file from being minified and it will remain render-blocking.
    Once again, W3 Total Cache cannot handle external files and neither can any other plugin for that matter.
    Thanks!

    Thread Starter wpmhweb

    (@wppit)

    Thanks, I didn’t realized that, I thought the plugin will at least make it defer or async. I’ll try to change the design to remove the file, what would it happen if I download the jquery.min.js and host it on the web server, will this make any difference? Is it OK to host js files like the one here in question on the web server?

    Thanks again.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wppit

    Yes, it’s possible to host the file. Then it can be handled by W3 Total Cache and you can add it to minify manually.
    However, since the file is already minified it may cause the same issues. it does not hurt to try, however, we cannot guarantee that it will work.
    In one way Google pushes you to improve the score of your website, and in the other, they don’t care when it comes to those types of files ??
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to fix JS minify problem with W3TC?’ is closed to new replies.