Gareth Lennox

WP Super Cache not caching (solution)

(this post is more a note to my future self than anything else)

The WP Super Cache plugin for WordPress is a pretty awesome plugin. The other day I was having problems with it not doing any caching and spitting out the following just before the head tag (where the wp_head() call is):

<!-- Page not cached by WP Super Cache. No closing HTML tag. Check your theme. -->

This was very odd. Everything I could find on the web regarding this problem was seeing this tag at the end of the html. Eventually I found a post that sounded similar to mine (and of course now I cannot find it again, unfortunately). It mentioned a plug-in using output buffering incorrectly. This makes sense, as looking in the source code of WP Super Cache, it outputs the message above in its output buffer handler if it cannot find a </html> closing tag. Needless to say, after a couple of hours fiddling, it turns out that it was a plug-in that I had written especially for the site, and it was doing exactly what the post mentioned (i.e. it was calling ob_end_flush() without calling ob_start()).

So it was all my fault, and I’ll probably do it in the future, hence this post!

So, note to self: If you see this in the future, check the plug-ins.

One Response to WP Super Cache not caching (solution)