Question

I'm building several WordPress themes in which I like to use a number of plugins like Jetpack and Gravity Forms, unfortunately they add a number of extra javascript and css requests to the site. Which causes a fair amount of added loading time to the server on slower connections.

Obviously as these plugins are updated regularly it would be very impractical to compile them into single js and css files by hand and keep them up to date. Is there anyway of automatically compiling these requests into one without manually editing the files?

Maybe a plugin of a simple piece of code that preloads the files into a cache and sends them as one request?

Was it helpful?

Solution

Considering you are using Wordpress I would suggest leveraging the plugins that exist to help you to solve this issue and save you time.

You can use this wordpress plugin for minifying and combining your static assets. https://wordpress.org/plugins/bwp-minify/

Some further reading around this plugin: http://betterwp.net/wordpress-minify-javascript-css/

I would also recommend compressing your files when they are served using Gzip. The implementation would depend on your web server.

I'm not affiliated with the developers of this plugin but it works well for me. Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top