jpcache with Movable Type

I’m again using jpcache with my blog. This time however, I’ve integrated the PHP-based gzip and caching capabilities of jpcache with Movable Type.

You should see a significant speed improvement through out the site — especially on some of the longer category pages.

It was fairly easy to incorporate into MT since I’m already outputting PHP files from my MT templates. Basically, after following the uncomplicated install guide for jpcache and running a few sample test pages, all I needed to do was “prepend” the jpcache script to the end of my PHP files.

You can do this by adding a require(‘/path/to/jpcache.php’) to your MT templates and rebuilding them as PHP scripts.

Or simply create an “.htaccess” file at the root of your blog directory and add the php directive “auto_prepend_file”, which will append the specified file to the end of every PHP script within your blog directory (this includes sub-directories).

For example:

php_value auto_prepend_file /path/to/jpcache/jpcache.php

So far, I’ve found only a few downsides however…

Since files are cached for 15 minutes by default you will not see updates reflected on the site until the cached file expires. Of course the cache expiration is configurable and in fact you can turn it off entirely, so it’s not a show-stopper for me and I’m happy with the outcome.

Ultimately however, I like to be using the Smarty Template Engine, which Brad Chocate integrated with Movable Type, but for basic file caching and gzip compression, jpcache suited me well.

BitTorrent, Blogs and Web Proxies

Don Park gives a good overview of BitTorrent, but also provides an interesting perspective on how blog software in general could utilize BitTorrent technology.

“In my opinion, flash flood nature of blogs will be well served by BitTorrent. Likewise, link-happy nature of blogs will complement BitTorrent well. Ultimately, I think a tailored variation of BitTorrent should be built into blog clients and servers for download sharing of feeds, images, enclosures, and other blog-related resources. BitTorrent will encourage media-rich blog posts without applying power-law to the bloggers’ wallet. BitTorrent means blog torrents.”

I agree, but perhaps this idea shouldn’t be limited to just blogs. I believe it can be applied to any URI accessible resource.

It may have been said before, but I can imagine using P2P concepts like BitTorrent in a hybrid Smart Web Proxy.

For example, when a request for a URI is unavailable or times-out, the Smart Web Proxy would check trusted sources for a cached copy of the URI.

Specifically, these trusted cache repositories may well include: BitTorrent sources, Google’s Cache, The Way Back Machine, and perhaps even Freenet sources. Trusted BitTorrent sources can be determined by walking a list of peers culled from a users’ blogroll, which is of course managed via OPML.

Indeed, I’m taking the 500-foot view, but perhaps this is worth further investigation … note to self … see what you can dig-up on Google