Making WPtouch and WP Super Cache Play Together

I installed a plugin for WordPress on the blog yesterday after getting a tip from Morten Røvik about WPtouch. This is a plugin which provides a custom theme for all your visitors that are using mobile devices, such as the iphone and the blackberry line of products.

The problem is that I’m already running WP Super Cache, a caching plugin that writes all the pages wordpress renders to static HTML files, and this conflicts with plugins that want to change the theme of the page on the fly. After a bit of searching (the WPtouch page mentions WP Cache, the plugin that WP Super Cache builds on) I decided to see if WP Super Cache supports the same exceptions based on user agent that WP Cache does, and lo and behold: WP Super Cache has a configuration setting just for this!

  1. Log in to WordPress
  2. Select “WP Super Cache” under “Settings”
  3. Select “Mobile device support. Plugin will enter “Half-On” mode.” in the settings list
  4. Save settings
  5. Delete the contents of the WP Super Cache by clicking “Delete Cache” in the WP Super Cache settings page (IMPORTANT if you’re going to test if things are working!).

The “Half-On” mode means that WP Super Cache caches the files with a small block of PHP code at the beginning instead of the pure HTML files, so that it can check the user agent of the client before deciding which files to return to the user. This is a performance hit (although much smaller than leaving things uncached), so if you suddenly end up with a very, very large amount of hits in a short time, switch the plugin back to full mode.

2 thoughts on “Making WPtouch and WP Super Cache Play Together”

Leave a Reply

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