500Kb Of Js Loaded On Each Page?

Hi guys

Every page loads a js of about 500kb.

/public_html/var/cache/misc/assets/js/tygh/scripts-54166ad7b2a5e5980c6b3ef8fe2d29d1473070037.js

Is this right? It seems like quite a big script and I'm unsure what it actually does. Should it be loading from the cache? I'm trying to get website fully optimised. Thanks

www.digitalsave.co.uk

That's actually a compiled file of all scripts used by CS-Cart and any active addon. 500kb does indeed seem pretty large (ours is around 220kb). Do you have a lot of addons installed?

Yeah a few, but they seem to have their own scripts loading. It's probably something to do with this awful theme we're using.

You could disable compilation of JS files by changing $config['tweaks']['dev_js'] to true in config.local.php (line #100 in my case). You could then view your page source and look for .js files to see what size the individual file sizes are. This should give you an indication as to what part is causing your compiled JS file to be this huge.

Should be cached by the browser and only donwloaded on 1st access unless you have the "Rebuild cache automatically" setting turned "on". If it's on, all of the "static" files are loaded for every page load so you can make changes without having to clear the cache in between changes. Just go to Design/Themes and in the upper corner, turn it off. I thiink you'll find that it then donwloads once (unless you have done something that modifies it).