- This topic is empty.
May 20, 2013 at 6:01 pm #44910mikemanMember
I’m using WP and WooCommerce with a theme from themeforest.
Over all there’s quite a bit of js files being loaded, I’m trying to reduce http requests and it looks like removing some JS files would be a good start.
I’m also hoping that the JS files that are in-use, on specific pages…. i might be able to determine which pages and simply make some if statement to load them in the header If…. its actually needed and not just on every page.
Could anyone help me figure out how to do this? I’v been told to combine js files but I dont understand that, like if i just copy the contents of one js file, paste in another… then remove the old one.. things will still work? seems like i might be missing something
Thank you!May 20, 2013 at 7:04 pm #135781PixelClawMember
Just type the link of your website with the active ThemeForrest template and hit “Test Now”! You’ll get a precise timeline in which you can check what is going on under the hood.May 20, 2013 at 7:11 pm #135783mikemanMember
I dont understand, I can see all the js files that are loaded but how does this tell me if their actually being used by something on the page?May 20, 2013 at 7:35 pm #135784AlenParticipant
You can concatenate your .js & .css files using Apache. [See line 510 on HTML5 Bolerplate, .htaccess](https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess) file!
– jquery (1 request)
– slider (1 request)
– functions (1 request)
Get merged into:
– app.js [jquery + slider + functions] (1 request)
> like if i just copy the contents of one js file, paste in another… then remove the old one.. things will still work?
Same idea with CSS. One important thing to remember with both is to merge them in the right order.
Hope that helps,
-AlenMay 20, 2013 at 7:42 pm #135786AlenParticipant
> how does this tell me if their actually being used by something on the page?
If you are running small size website, I would just concatenate and pre load all the scripts.
How many files are we talking about? What is the size in KB?