WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
do not cache iPad (4 posts)

  1. Chris Abraham
    Member
    Posted 2 years ago #

    Does anyone know how to get wp-super-cache to avoid serving a cached file to just an iPad? That is, I want WordPress to generate the theme each request for the iPad. I tried playing around with the cached_mobile_browsers filter but it doesn't seem to be quite what I need.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Chris Abraham
    Member
    Posted 2 years ago #

    Anyone know about this?

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Enable PHP mode and you'll have to write a small wp-super-cache plugin that fires off the "cache_init" cacheaction in wp-cache-phase1.php. If you see an iPad visitor then set the variable $cache_enabled to false.

  4. Chris Abraham
    Member
    Posted 2 years ago #

    Excellent. Thanks Donncha. That works great. Here's the code for those interested:

    function mycache_init() {
      global $cache_enabled;
    
      $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
      if ($isiPad)
        $cache_enabled = false;
    
    }
    
    add_cacheaction('cache_init', 'mycache_init');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic