PEAR Output Cache and WPMU

One of those things PHP doesn’t do well is load large libraries of scripts into memory and parse them quickly. WordPress and Smarty fall firmly into this category and the caching I’ve done so far has only addressed half of this problem: cached pages don’t load any WordPress code, but the heavy Smarty library was still loaded.

I’ve now modified my code to use the PEAR Output Cache and that avoids loading the Smarty templating system. On a heavily loaded server this should make quite a difference to visitors. Things still need tweaking, I may need to introduce a “time” aspect to the cache key as pages could be cached indefinitely but for now it seems to be working really well!
Note to self, please remember that gzip compression upsets PHP’s output buffer. Note to everyone else, don’t set “gzip compression” in the backend or your blog will be foobarred! (Thanks Mel for testing his blog and reporting problems with it!)

One thought on “PEAR Output Cache and WPMU

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close