jpcache with Movable Type

Blogs December 2nd, 2003

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.

Related Posts

  • PHP Caching with JPCACHE -- Sweet! I just configured jpcache to cache and gzip compiled pages on hatch.org. So the b2 powered blog should feel snappier. I need to work out a few of the kinks with respect to expiring the cache when there are...
  • Movable Type Blog Migration -- Over the last week, usually in the mid-to-late evenings — after Catherine falls asleep, I have been slowly migrating my B2-based blog to Movable Type. I must say that for the most part the process has been fairly straight forward....
  • Social Bookmarks Manager Right-Click Context Menu -- Last night I hacked together a bit of JavaScript to add a right-click context menu posting option to Joshua Schachter’s Social Bookmarks Manager. It works in a similar fashion to the bookmarklet, but is accessible via the right-click context menu...
  • Disable MovableType’s Send Entry Script -- The file ‘mt-send-entry.cgi’ in a default MovableType installation can be used to relay spam. If you’re not using the script to allow your users to “Send this Entry by Email”, you can safely remove the file from your MT install...
  • links for 2005-05-01 --  Burning Questions – The Official FeedBurner Weblog: Google AdSense Support “FeedBurner has implemented support for this capability. Google is currently testing this program with just a few publishers, but as the program becomes more widely available, and your Google...
  • PostNuke Template Rendering Engine -- An overview was posted on the PostNuke site about the Smarty-based Template Rendering Engine for PostNuke Phoenix. I can’t wait to see this in at least a beta. I’d love to rid theme templates of those nasty nested tables and...
  • Blog Time Graph -- I received a cool script from Sanjay, which graphs what time of day my blog posts were made for the past 30 days.Thanks Sanjay! ...