As a followup to my earlier complaints about the slowness of WordPress (the software that creates this page you see), I’ve managed a pretty good speedup with some lazy caching of filtered content. I’ll make my changes publicly available in the next day or two when I manage to get things cleaned up a little. The basic operating theory is to take the plugin filtered content and save it into the database and then use that rather than refiltering the text every time the page is rendered, of course this work is done when an article is requested that is not already available prefiltered.
Of course, there are some catches.
- If you change your set of content filter plugins you have to invalidate the cached copies of the filtered content.
- This could be very easily automated with the wp-admin page that changes the plugins clobbering the cached copies.
- The Textile filter in particular needs some minor tweaks to keep it from gobbling the comment based “more” and “nextpage” directives for WordPress.
- My quick solution to this was to change the normal single hyphen for the del tag in Textile to be three hyphens.
- A better solution would be to armor the more directive somehow. Or change it to be less susceptible to being clobbered. Or fix the Textile filtering engine so it leaves comments the hell alone. I think I like the last one best.
- Interactive plugins like the search word highlighting plugin will not work.
- Fixing this requires the WordPress authors to separate cacheable plugins from interactive ones.
- I need to backport the security fixes to WordPress-pg
I should point out that this has resulted in a increase in rendering speed for this home page from 3 seconds to 0.4 seconds on some slow old hardware. Nearly an order of magnitude. And from surfing around other WordPress pages, it looks like I’m not the only one that could use this little fixup. I must admit though that I’m not following what is going on in active development of WordPress.