Speed Up Your WordPress / BuddyPress Loading Time With This Quick Tip

Minify is a PHP 5 app that “combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.” The WP Minify plugin makes it easy to integrate Minify into your WordPress / BuddyPress site and in most cases will work right out of the box without any adjustments.

How Does the WP Minify Plugin Work?

According to the plugin page:

WP Minify intercepts theme rendering at the get_header WordPress hook and puts everything that is echoed/outputted from the PHP code into an output buffer.
WP Minify then intercepts theme rendering again at the get_footer WordPress hook to stop the output buffer.
The plugin then evaluates the page content to extract all JavaScripts and stylesheets out.
The minified version of these JavaScripts and stylesheets are then re-injected into the content.
The page content is echoed/outputted as normal.

Installation is simple. Go to Plugins >> Add New. Activate WP Minify. Make sure you make the wp-content/plugins/wp-minify/cache writeable by the server. You shouldn’t have to do anything else.

How Will I Know WP Minify is Working?

After you activate the plugin, view the source of your site and you should see it outputting the CSS and JS files with paths similar to this:

wp-content/plugins/wp-minify/min/?f=/wp-content/plugins/buddypress/bp-themes/bp-default/style.css

wp-content/plugins/wp-minify/min/?f=/wp-includes/js/jquery/jquery.js,/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js,/wp-content/plugins/sidebar-post/js/validate.js

You should also notice a difference in your site loading speed. I noticed a significant increase in speed on my test site right away. Here are screenshots from my Firebug before and after.

My test site’s HTTP Requests BEFORE WP Minify (3 Javascript Requests @ 96KB)

jsnotminified

My test site’s HTTP Requests AFTER WP Minify (1 Javascript Request @ 27KB)

jsminified

My HTTP requests were reduced to a fraction of what they were before minifying the files. That was simply a BuddyPress test site with very little content. Your results are bound to better than mine. Take two minutes to install and activate this plugin and you will make your site a few seconds more zippy than it was before. Those couple of seconds can make a huge difference in the world of internet time where impatient users will leave unless you instantly capture their attentions. Please also note that this plugin does work with WP Super Cache. If you have any issues, check out the developer’s post on troubleshooting WP Minify.

Comments (7)

  1. We’ve always had mixed success with this plugin on our installs. Our Yslow / PageSpeed scores improve using it, but these tools also show us that our pages take about 2 more second to load and I see this in real world page views as well. This is with and without super cache installed….. go figure. :)

Participate