lyncd

HTML Minify for WordPress and WP Super Cache: Now a plugin!

It’s been a while, but I’ve updated my code that adds Minify to WP Super Cache, making everyone’s favorite WordPress caching plugin that much better.

What’s better is that my code now operates as a fully fledged plugin to Super Cache, so it’s now a drop-in install (no more patches!). Go to WPSCMin’s project page for all the info.

On an almost completely unrelated note

Update 11/2010: I convinced Donncha to up the default gzip level of WP Super Cache to 6, so if you’ve come to the same conclusion as me, you don’t have to patch Super Cache anymore.

Quite a while ago, I wrote about experimenting with gzip compression levels for static HTML and concluded that zlib’s default (level 6) probably makes the most sense for an application like WP Super Cache.

At the time, Super Cache was using level 1 (compared to which, level 6 is an improvement of 5.9% file reduction at a cost of just 1/5 of a millisecond — and that on what was a slow test machine). Super Cache has since moved up to level 3.

If you’re like me, and still prefer to use zlib’s default, there’s now just one line of code in Super Cache’s wp-cache-phase2.php that you have to change. Here’s the edit for WP Super Cache version 0.9.9.3:

=== modified file 'htdocs/wp-content/plugins/wp-super-cache/wp-cache-phase2.php'
--- htdocs/wp-content/plugins/wp-super-cache/wp-cache-phase2.php	2010-08-08 04:07:50 +0000
+++ htdocs/wp-content/plugins/wp-super-cache/wp-cache-phase2.php	2010-08-08 04:08:14 +0000
@@ -444,6 +444,6 @@
 		$buffer = apply_filters( 'wpsupercache_buffer', $buffer );
 		if( $gz || $wp_cache_gzip_encoding ) {
 			if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "Gzipping buffer.", 5 );
-			$gzdata = gzencode( $buffer . "", 3, FORCE_GZIP );
+			$gzdata = gzencode( $buffer . "");
 			$gzsize = strlen($gzdata);
 		}

Filed under: Code.  Tagged: , , , .