There is a plugin called "Autoptimize" https://en-ca.wordpress.org/plugins/autoptimize/ its great, but use it with caution. Below are the most safe and effective settings, if you experience issues with you theme simply uncheck CSS or Javascript.