A WordPress Developer recently suggested the Autoptimize plugin in a Facebook Group I follow. The plugin claims to “speed up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.” I’ve implemented this plugin on several high-traffic WordPress websites and I’ve not ran into any issues. In all cases I have seen considerable performance improvements. There’s quite a few settings in the Autoptimize plugin so I will go through the options panel step by step.
HTML Options in Autoptimize
CSS Options in Autoptimize
The option “Generate data: URIs for images” converts images that are smaller than a set size into data: URIs. This is essentially a super long string of gibberish that your browser interprets to be an image. The benefit of this method is that it eliminates HTTP requests which will immediately increase the performance and reduce the loading time of your WordPress powered website or application.
The “Look for styles only in ?” option is potentially necessary if your WordPress theme has many CSS stylesheets. There is a certain point, which depends on your users internet connection speed, where it’s more beneficial to have 2 medium-sized CSS stylesheets instead of 1 large CSS stylesheet. If you have more than 8 or 9 CSS stylesheets the I would recommend activating this option and performing some performance analysis tests with WebPagetest, an open source project supported and developed by Google.
I would not recommend activating the “Defer CSS loading” in almost all cases. Actually, I can’t really think of a scenario when you would want Autoptimize to do this (got one? let me know in the comments). Activating this option will make Autoptimize load everything else on your page, including images, before the CSS styelsheet(s) is requested. This results in your page being loaded in an unformatted style which will leave your site visitor irritated. Similarly, there is no real reason to inline all your CSS with the “Inline all CSS?” option unless you have less then a few dozen lines of CSS for your entire WordPress site — which is highly unlikely.
CDN Options in Autoptimize
Well, that’s all there is to the Autoptimize WordPress plugin. It’s really improved several medium and large-sized WordPress websites I maintain. I urge you to at least give the plugin a try and of course leave your comments and questions below.