Cloud Four Blog

Technical notes, War stories and anecdotes

We Have Disabled WP Super Cache

To improve your WordPress performance we have previously advocated using the WP Super Cache plugin to enable pages served from a static cache.  This works quite well unless you are doing some form of content adaptation that is specific for the device accessing your site.  Like you might do for mobile devices.

Some time after enabling the Super Cache plugin we noticed that our blog’s mobile adaptation had stopped working.  Mobile users were seeing the normal web view of blog posts and that was no good.  This was because the cache happened to contain a normal web view.  Interestingly enough, it could also have gone the other way to provide a mobile view of the blog to desktop web browsers.

So, we have turned the plugin off for the time being.  I have some ideas for working around this issue and if I manage to find some time I’ll give them a shot and let you know how it goes.

3 Comments on “We Have Disabled WP Super Cache”

  1. Thomas says:

    What about disabling the cache just for mobile users? That would reduce the hit on regular users, and allow adoption for mobile users as well.
    I used the following approach: I added the iPhone User-Agent as being uncached (both in htaccess and WPSC). It works like a charm, with the tradeoff that mobile users are not served from the cache. But better than no (super) cache at all.
    For example add this line after the HTTP_COOKIE line in .htaccess
    RewriteCond %{HTTP_USER_AGENT} !^.+iPhone

  2. John Keith says:

    Hi Thomas:

    I think you are on the right track here. Basically you are proposing an adaptive caching strategy to complement an adaptive content strategy. I would generalize this approach to say that your caching strategy should fully accommodate your device classes. That is, why not cache pages for each device class? With this approach we can maximize performance for all devices at the expense of a relatively small amount of cache storage capacity.

    Thank you for suggesting this line of thinking.

    – John

  3. You chould also step it down into half mode. You won’t get the hard coded static files but you will get the data saved and that’s better than nothing. That’s what we run our WordPress Mu installs with.