WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
WP Super Cache and WPTouch (21 posts)

  1. picmax
    Member
    Posted 2 years ago #

    WP Super Cache (WSC) supports mobile devices but it is a headache to make it work properly.

    In my case, I use WPTouch. It appears that when WSC detects a mobile device, it will pass the request to WPTouch to render it and saves the content in index-mobile.html file. When another mobile user comes, the index-mobile.html will be served to the user.

    Problem arises if users want to switch the WPTouch to view the full site. WPTouch includes a mode switcher in the footer. The problem is even if the user is able to switch it to the full site, WSC saves that full site as index-mobile.html. When next mobile visitor comes, he/she is served with the cached full site that is saved in index-mobile.html!!

    Unless you want to disable the mobile/normal mode switch in WPTouch, which is not a good idea, mobile users will be shown with inconsistent content formats.

    The only way to fix this seems to be disable caching for mobile users all together. However this cannot not done by turning off mobile user support in WSC. Doing so will make WPTouch useless.

    I'd like to suggest the plugin author to add an option to not cache at all for mobile users but makes sure WSC hands off to WPTouch nicely.

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

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    That's a good idea, but a better way would be for WP Super Cache to somehow recognise the desktop switch and then serve the ordinary cached pages. I'll see what I can do but there are only so many hours in the day ..

  3. picmax
    Member
    Posted 2 years ago #

    It may not be too difficult. The key is to prepare two different versions for mobile users: one is the small screen version and another is full version. You cannot simply serve the full site cache for desktop browsers because the full version generated by WPTouch has a mode switcher in the footer while the regular one does not.

    WPTouch uses cookies to know which version the user wants. wptouch_toggle_switch has two values: mobile and normal. If WSC can somehow intercept the cookie and respond with one of the two mobile versions it should be ok. The cookie is only set when user first clicks on the mode switch so WSC can by default serve the true mobile version when mobile device is detected but the cookie is not set.

    Currently I have found a workaround to get the mode switch to work: I added "wptouch" to the cookie list that is used to detect known users. However this means no caching. This is also somewhat consistent with my original suggestion. But I agree a better solution is to have WSC work better with WPTouch.

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    I added code to the dev version that checks for the wptouch_switch_toggle cookie. Check wp_super_cache_wptouch_cookie_check() in plugin/wptouch.php in http://downloads.wordpress.org/plugin/wp-super-cache.zip for usage.

    I haven't tested this so feedback would be appreciated!

  5. AA
    Member
    Posted 2 years ago #

    Hi Doncha,

    Thanks for this fix as well! I'm the one with the post going here:

    http://wordpress.org/support/topic/wp-super-cache-experiencing-sudden-problems?replies=2#post-2789989

    Don't want to cross post here so please feel free to respond at the above post, but I assume that this update includes the same fixes that are in the dev version that you suggested in the other post?

    You'll notice that my response there mentions that I too use WPTouch!

    Thanks!

  6. FolioVision
    Member
    Posted 2 years ago #

    Hello Donncha!

    the new WP Super Cache (1.1) seems to be caching the mobile version provided by latest WPTouch Pro (2.7).

    However the switching of mobile site to desktop doesn't work. I found the above post about the new WPTouch plugin which you created for WP Super Cache posted above.

    It's not helping. As soon as I activate that plugin, my computer gets the mobile version, same as my smartphone. I use "Use PHP to serve cache files" and "Mobile device support".

    The cookie set by WPTouch Pro is "wptouch-pro-view", but in your plugin I'm seeing "wptouch_switch_toggle". I'm not sure if that's the reason, but it's weird.

    Or do we need to program around the wp_super_cache_wptouch_cookie_check() function? I think this should work out of the box.

    Thanks,
    Martin

  7. Nikos M.
    Member
    Posted 2 years ago #

    i have the latest super cache (1.1) and latest wptouch (1.9.41)
    and they dont work together (previously they did, prev version for wsc and prev version for wptouch) when i access the site through mobile device i see the desktop version.
    is there some setting to make this work?

    thanx

  8. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    FolioVision - ah, you'd be using the Pro version of WPTouch then?

  9. FolioVision
    Member
    Posted 2 years ago #

    Hello Donncha,

    yes, we use the Pro version. Will changing the Cookie name fix the issue? Do you have experience with that? We can try that out and let you know.

    Thanks,
    Martin

  10. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Ah ha, no, I can put a check for that in the plugin. I presume when you switch to desktop view that cookie's value is "normal"?

  11. FolioVision
    Member
    Posted 2 years ago #

    Hello Donncha,

    actually - it's "desktop". It's not very good that there are such differences between versions of the same plugin (WPTouch Pro/WPTouch).

    Thanks,
    Martin

  12. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    OK, so I found WPTouch Pro on someone's svn directory for their website (oops) and figured out that it sets that cookie to "desktop".

    I updated the wptouch plugin in wpsc. You can grab it here. Copy that file into wp-content/plugins/wp-super-cache/plugins/ where it should overwrite the file already there.

    If you can wait 20 minutes, try the development version. More details here: http://ocaoimh.ie/y/2o

  13. FolioVision
    Member
    Posted 2 years ago #

    Hello Donncha,

    thank you for your reply and quick action.

    I'm sorry, but the fix does not help, it's still the same as described above: http://wordpress.org/support/topic/wp-super-cache-and-wptouch?replies=12#post-2865032

    I noticed that the check for Cookie was changed in one place, but not in the other (in the wp_super_cache_wptouch_cookie_check function).

    Handling the proper cookie is one thing, but there is still the problem with the mobile version caching as desktop version when the WPTouch plugin for WP Super Cache in activated. There is no cookie stored until you switch from mobile to desktop version.

    Thanks,
    Martin

  14. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    OK, I updated the wptouch.php again if you'd like to try it. Hopefully that will fix the caching of the mobile client.

  15. FolioVision
    Member
    Posted 1 year ago #

    Hello Donncha,

    sorry about my delayed reply here.

    I tested your latest fix. As soon as the WP Super Cache WP Touch plugin is turned on and you visit a page on mobile, the main cache file for the page gets the mobile version. So visiting it again on PC shows the mobile site.

    I only did a quick check to see if I can figure this out and I:

    1. Figured out it's not any of these action

    add_cacheaction( 'wp_super_cache_mobile_browsers', 'wp_super_cache_wptouch_browsers' );
    	add_cacheaction( 'wp_super_cache_mobile_prefixes', 'wp_super_cache_wptouch_prefixes' );
    	add_cacheaction( 'wp_cache_check_mobile', 'wp_super_cache_wptouch_cookie_check' );

    2. Figured out that .htaccess has no effect on mobile caching if you are using mod_rewrite caching. It seems that all of it is going through PHP. Please correct me if I'm wrong.

    Thanks,
    Martin

  16. emilybinder
    Member
    Posted 1 year ago #

    Hello Donncha,

    I noticed that my mobile website (viewed on iPhone4) would not toggle to desktop version. Link to my website I haven't tested the mobile on/off in a month or two, so not sure when this change occurred (maybe during a plugin or WP update?)

    I have the most updated version of WordPress and both plugins active and updated: WPTouch and WP Super Cache

    My goal: Enable the mobile site on/off button so mobile users can see the desktop version.

    I have now done something or a few things that have totally hidden my site on mobile and desktop. Zero content shows up. I think this is due to me changing settings in the cache plugin. Hoping you can help:

    Before I go through all my steps, I want to know if a quick fix might be to reset WP Super Cache to default settings? Could that mess anything up?

    I think the problem maybe related to the home page/static page in WPTouch settings. I had home set to none specified and posts page set to Marketing. I changed home to Home and then to marketing during my tests but neither helped.***

    Steps I took:
    1. I went into my WPTouch plugin settings. I noticed that WPTouch was "disabled") but that my mobile site was displaying fine. Since it seemed like it could help get the toggle on/off working, I changed it to "enabled" and saved. I also changed the WPTouch mobile settings from the previous to display

    Note that I do not have the colors like blue, green, I just have the one mobile theme.
    Appearance --> Mobile Theme
    Clicked on link at top to switcher settings page. Got this message: You do not have sufficient permissions to access this page.
    Edited the other configurations that I could:
    Had Enable Nokia templates already checked.
    Check mobile status: launched ready.mobi and got a score of 2
    Show home link in menu: this was checked. I unchecked (unselected) it. "Unselect this if you are using a dedicated page for the blog home. It prevents 'Home' appearing twice in the menu." (***This might be part of the problem? I now want to display all my posts from all categories. I had previously been showing just Marketing category posts.)
    Kept other settings same:
    List of posts to show: show title and teaser for all posts
    Yes (checked) display metadata for posts.
    Teaser length 50
    Number of widget items: 5

    I saved changes.

    I think it was at this point when my mobile website showed no content.

    2. I looked up support forums which said that if you have WPTouch and WP Super Cache, be sure to set the caching plugin to allow for the WPTouch mobile site to cache.
    WP Super Cache Settings
    Easy:
    Caching was already on
    Advanced:
    Box already checked: Caching hits to website for quick access
    Box checked: Use PHP to serve cache files
    The only other boxes checked were:
    Misc section:
    Cache rebuild
    I went to Advanced section and checked Mobile device support (it wasn't before).
    These were listed:
    Mobile Browsers
    Android, CUPCAKE, Googlebot-Mobile, bada, blackberry 9800, blackberry9500, blackberry9520, blackberry9530, blackberry9550, dream, iPhone, iPod, incognito, s8000, webOS, webmate

    Mobile prefixes:
    none
    No more boxes checked.
    Expiry Time & Garbage Collection
    Cache timeout: 3600 seconds
    Scheduler: Timer: 3600 seconds

    Lock Down: Disabled

    I saved.
    CDN: did not modify this section. "Enable CDN Support" is not checked.

    Contents: Did not modify section.
    Wp-Cache (15.83KB)
    3 cached pages
    0 expired pages
    WP-Super-Cache (89.21KB)

    Preload
    This section I did make a change. I never had touched it before.
    Refresh preloaded cache files every 0 minutes. (left this at 0).
    I check the box for Preload mode (garbage collection only on legacy cache files. Recommended.)

    Plugins
    Everything was disabled. I changed WPTouch to Enabled and saved.'

    Debug
    Did nothing here. It is not enabled.

    I would really appreciate your help -- thanks in advance.

  17. Jonathan Dingman
    Member
    Posted 1 year ago #

    Any updates here @donncha?

    I'm running into this same problem.

    I have Super Cache enabled with WPTouch support (I run WPTouch Pro), but when I view it on my mobile device, it's serving up the desktop cached page.

  18. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    No, haven't had a chance to look at this in ages. :(

  19. tejprakash2580
    Member
    Posted 1 year ago #

    I am also facing the problem with wptouch, My site was running fine with wptocuh enabled in wp super cache from last six months, but suddenly i faced the problem that even in desktop browser mobile theme is opening by default. I then disable and and enable wp-touch and even uninstalled , installed wptouch but problem is still there. Even my website failed to load then what i have done , I rename plugin folder using fileZilla to plugin1, dashboard come after I have disabled both the option mobile support in advanced setting and in plugin disable wp touch. after that also changed caching option as php cashing in place of mod_rewrite rules. In .htaccess file i delete all the mod rewrite rules. After that my site come alive. I have tried many times to again enable wptouch but same problem. Now I am not able to set mobile theme any solution

  20. tejprakash2580
    Member
    Posted 1 year ago #

    I suppose this has happened due to upgrade of wordpress to 3.4.1 recently.

  21. stgoldmann
    Member
    Posted 1 year ago #

    Just wanted to say: same here. WP Super Cache either caches the mobile or the desktop version and serves them to both clients. :o( A fix would be so great.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic