16 thoughts on “WordPress Caching, part 3: Custom Caching Library Leave a comment

  1. I’d be careful about using a disk cache for WordPress, unless you know specifics about the server setup. For instance, using a disk based cache can actually make performance worse in some setups, usually where the “disk” is actually mounted over the network. This can be particularly common in shared server environments.

    Disk caching has another challenge, it focuses on a single web server. That can cause problems for sites that use more than one front end web server.

    As a general solution, in the context of WordPress, I’d push that data into options. An added benefit of that approach is that if they do have an object cache plugin installed (say for memcached for instance) then you’ll get the benefit of that automatically, not extra work needed.

    1. Hey Joseph – thanks for the feedback. Would you recommend that for things like caching feeds/ xml (from Twitter api for example) as well?

      What are your opinions of plugins like WP_Super_Cache that do page caching on disk? In my opinion (and experience) small sites generally don’t have any problems with using a disk based cache – it’s larger sites with many visitors that get into problems have lots of disk based activity.

  2. Disk based caching is fine, under certain server setups. The assumption is that an admin installing WP_Super_Cache knows if his server setup will benefit, and not get worse, from using it. If a theme or plugin tries to do it’s own disk based cached, it usually isn’t obvious to the admin (without looking at the code), so he doesn’t get the opportunity to make the same specific decision about how caching should work on their particular site.

    As for caching feeds or Twitter XML data, should be fine. WordPress itself uses options to cache the admin dashboard feeds.

    1. Hey Joseph, thanks again for the feedback. I think I am going to add db based caching to my todo list and maybe make it a user configurable option.

      I think the assumption that people know the limitations of WP_Super_Cache is wrong though. My guess is that most people will see something like a statement that reads “WP_Super_Cache will speed up your website” and then install it – irrespective of the server setup. My guess is that those who are (or have hired) knowledgeable System Admins are unlikely to need WP_Super_Cache anyway, as they will be using something like Memcached… which actually kind of proves your point, and means I should use the built in WP caching object even more than I do.

      1. Agreed, no doubt that people have installed WP_Super_Cache without looking at their environment closely enough to see if it will help or hurt. My point was more that an admin installing a caching plugin is at least more likely to know if it will help or not, than a theme or plugin that does it blindly (everywhere it is installed).

        I expect at some point there will be hosting providers that leverage these caching plugins. It would be great if they were integrated right into the one-click installs that many of them have. Then again, I’ve been saying this for a few years.

  3. we all have problems with wp catching and still i couldnt find the right solution ..
    as much as i do is les querries or try to have more badswitch.. does anyone know catching system with multilanguage wp site

  4. Hi Ben,

    off topic,
    just want to let you know that
    i see in my rss feed,
    two of your posts images use
    the “I took this images” warning,

    I just thought that it was only in my google reader
    but after visiting the posts, both posts use the warning images,
    i’m pretty sure that you didn’t intend to use it as your post images.
    hope it help,

    Dian

    1. Hey Dian – thanks for the message. The problem occurs because I am using a cdn and the ‘you stole the images’ image is being cached by the cdn instead of the real image. I think I have fixed the problem but if I haven’t then I will remove the code.

  5. Ben, thanks so much for this, I definitely have a need for just this type of solution, as I find the caching plug-ins to be swiss-army type tools, without granular or low-level caching I need, when building apps which work with WordPress.

    Cheers

  6. Have a question… I’ve used both w3 and wp super cache.

    If I have a low server load on my shared server running wordpress with traffic under 10,000 page loads a day; w3 blows supercache out of the water

    Once I start getting to around 150K pageloads a day running w3 my server is basically nonfunctional. With wp supercache it’s still not even sweating…

    I’ve tried both disk and memory based caching in w3 and database caching on and off; makes no difference when exp high traffic.

    Any ideas?

    1. Hey Craig – I don’t have any ideas I’m afraid. I do know that W3 Total Cache is considerably more complicated so I guess the additional processing it does to minify content etc is what is weighing down the server.

      I use W3 Total Cache here and love it, but I agree with you, I am thinking about swapping back to WP Super Cache to compare page load speed. Will be interesting to see the results.

  7. we all have problems with wp catching and still i couldnt find the right solution ..
    as much as i do is les querries or try to have more badswitch.. does anyone know catching system with multilanguage wp site

  8. Hi Ben,

    off topic,
    just want to let you know that
    i see in my rss feed,
    two of your posts images use
    the “I took this images” warning,

    I just thought that it was only in my google reader
    but after visiting the posts, both posts use the warning images,
    i’m pretty sure that you didn’t intend to use it as your post images.
    hope it help,

  9. Ben, thanks so much for this, I definitely have a need for just this type of solution, as I find the caching plug-ins to be swiss-army type tools, without granular or low-level caching I need

  10. we all have problems with wp catching and still i couldnt find the right solution ..
    as much as i do is les querries or try to have more badswitch.. does anyone know catching system with multilanguage wp site

Leave a Reply

Your email address will not be published. Required fields are marked *