Okay
  Public Ticket #535267
.js file too large, server won't load it
Closed

Comments

  • Rumi started the conversation

    Hello,

    My website was showing a spinning loading icon forever. After some investigating I found out the server is not loading this file, which actually exists: /salient/js/init.js

    Apparently the server (apache) won't load any .js files over 512 KB, and your file is 546.97 KB. I have no idea if this loading issue is specific to my hosting, still waiting to hear back from my hosting support.

    For an immediate fix in the meantime, I minified the init.js, which reduced it a bit, and now my site works. I can only hope the minification didn't break something that I am not yet aware of.

    I hope you can address this issue (perhaps by minifying the file on your end?), so my site won't break again with the next theme update.

    Generally it would be great if you can implement more sophisticated javascript handling, so only truly required javascript is compiled in a file based on theme settings, instead of flat .js files with everything possible in them. Hope that makes sense.

    Thanks,

    R

  • jeroen replied

    Hi,

    \"so only truly required javascript is compiled in a file based on theme settings, instead of flat .js files with everything possible in them. Hope that makes sense.\"

    I agree. To me that\'s the biggest downside of most/all multi purpose themes.

  • Rumi replied

    Hi Jeroen, I agree.

    Quick update about the issue from my hosting support: \"This was being caused by mod_security. Basically it was seeing that the content length was quite large, which triggered mod_security to block the file from loading.\".

    They are making a sever-wide change now, so I don\'t expect to have that issue again, and this ticket could be closed, but my previous recommendations still stand :)

  • ryan replied

    I am having the very same issue, waiting for my hosting to support to get back to me.

  • ryan replied

    Update-Arvixe support believes the issue is with the Salient Wordpress theme, not on their end. Possible \"Application issue\" is how they put it. Didn\'t elaborate any further than that.

  • Rumi replied

    Hi Ryan,

    My hosting support rep was at a loss at first, and had to transfer my request to their more experienced technician. Even though they are super nice, experienced in general, and responsive, I doubt they were going to investigate, and reply anything more than what your hosting rep said :D. Knowing that, I wasted a lot of time yesterday to try and figure it out on my own, and just gave the hosting support the exact reason...

    If you, like me, need your site up an running immediately, you can try my fix. See if it will work for you... This is a direct link to the .js file which I minified via some online service. It reduced the size to under 500KB and my site started working after that. Make a backup copy of the original init.js (just in case) and then try replacing the contents of the file with this: http://rumianalazzi.com/cms/wp-content/themes/salient/js/init.js

    FYI, before I changed anything, I made sure that I have updated to the last salient theme version, and apparently there was a plugin \"Salient Visual Composer\" that needed updating (which was NOT showing in my WP updates dashboard as usual). There was only a link for the update right under the plugin name (on the Plugins page). Updating everything possible did NOT fix my site, so then I investigated more and tried the minified file above. Hope that works for you too :)



  • ryan replied

    Awesome! Thank you, it worked.

  • Rumi replied

    Great! Now let\'s hope this will also be permanently fixed by the theme devs (and large .js files avoided in future) :)

  • jeroen replied

    I believe Better Minify/Gzip/W3 Total Cache supports ZIP which shrinks the files, which is always compatible with future updates.

    Nevertheless, the theme shouldn\'t load Javascript files which it doesn\'t use. It should be based on the theme options.

  • Rumi replied

    Good call Jeroen, and I am sure these are helpful, but I kind of want to avoid any plugins that may not be absolute necessity and 100% reliable right now. I have enabled compression (deflate) in my .htaccess, and hoped that is enough. Having a theme that apparently can break without any action on my end is enough to worry about, LOL. The worst is, I don\'t even know for how long my site was broken. I just took a look at it yesterday before sending my URL to someone, and found out it is completely non functioning, sigh.. Hope it won\'t happen again.

  •  8,990
    Tahir replied

    Hey Guys,

    The developer has notified me that he will be looking into this for the upcoming theme update .

    Cheers


    ThemeNectar Support Team