Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] Disable caching for mobile user agents

  • I’d like to disable caching completely (both super cache and wp cache) for either all mobile users or certain mobile user agents. I’m successfully using the hack found in this thread: http://wordpress.org/support/topic/wp-super-cache-couple-of-questions

    1.) First, I’ve ensured that my list of targeted user agents has been put into the “Reject User Agents” box in the Advanced tab of the WPSC settings page. 2.) Then I’ve added these lines to the .htacces file wherever necessary:

    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    # ADDED THIS LINE TO PASS-THROUGH MOBILE USER AGENTS
    RewriteCond %{HTTP_USER_AGENT} !(iPad|iPhone|iPod|Android|Danger|Playstation|BlackBerry)

    Since I’ve manually inserted the user agent rewrite WPSC now throws this warning on the Advanced tab of the settings page:

    A difference between the rules in your .htaccess file and the plugin rewrite rules has been found. This could be simple whitespace differences but you should compare the rules in the file with those below as soon as possible. Click the “Update Mod_Rewrite Rules” button to update the rules.

    My fear is that next time any settings are updated for WPSC my custom .htaccess code will be erased accidentally. Is there another way to go about disabling caching completely for mobile users or certain mobile user agents than this hack – one that maybe plays nice with WPSC?

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Donncha O Caoimh

    (@donncha)

    The rewrite rules will only update if you hit the submit form on that part of the settings page. Unfortunately that’s the only way of doing it right now.

    Ok, thanks for the response. Glad to know I’m doing things as correct as possible right now. Thanks again.

    Does it work to add Googlebot along with your other user agents? I tried but i still get cached content

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Super Cache] Disable caching for mobile user agents’ is closed to new replies.