This is a heavily modified version of the wordpress-varnish plugin on wordpress.org.