• andreatrasatti

    (@andreatrasatti)


    I have just started looking into W3 Total cache as I’d like to make the WordPress Mobile Pack (WPMP for short) compatible with it and maybe make the W3 Total Cache more mobile friendly (if needed).

    I looked up quickly the configuration and the code. The recognition system seems very simple and it looks like all the bits are in place, but there isn’t an easy way to extend. I have two options in my mind:

    • Extend WPMP to plug into W3 Total Cache and replace or extend the existing device detection
    • Extend W3 Total Cache to use the WPMP’s lite_detection

    My initial goal is to make our plugin work with Total Cache as I know it’s a very, VERY good plugin, but my overall goal is to make WordPress better with mobile. I am open to discussing ideas. I think we would be happy to take over the management of mobile device recognition and integrate in Total cache what we have in WPMP, if you are comfortable with that. I would also like to make it possible to cache mobile pages in locally stored files to be served by Apache completely by-passing PHP and that might need some extra work. Happy to discuss anything else that comes up.

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter andreatrasatti

    (@andreatrasatti)

    I looked up the code and there are two parts that would need to be addressed. In my view your choice of detecting a user-agent as mobile and redirecting to a different domain is OK, but limiting. What we like about the WordPress Mobile Pack and other plugins for mobile is that you can have everything in one place.

    In order to achieve this, if you think this is interesting for your plugin, we would need to make two changes, important, but should be easy enough to make. First we should allow plugins to define how a mobile device is detected, hence replacing the current _is_mobile function. Along with that we should allow the execution of PHP to continue so that the mobile plugin is fired and the appropriate markup and content are generated. This could be achieved with a hook as WP Super Cache does.

    Similarly, you could provide a hook/action so that third party plugins can modify the page key. Looking in PgCache.php there is the function _get_page_key(), if you provided a method for plugins to alter the key generated, then a plugin like the Mobile Pack could add a tag or keyword to refer to a cache of a mobile page. That way the whole structure would be preserved, but when a mobile device is detected the key would be different and a different cache file would be loaded.

    I have not investigated into all the CDN stuff, I suspect it might be unneeded for mobile, at least for now, but of course, if a site owner is interested in mobile and wants the best performance, that should be addressed as well.

    What do you think?

    I am also happy to write the code changes for your review since I’m already with my hands in the dirt. 🙂

    PS: what a bad title for the post that I picked, it seems a duplicate of another post, sorry!

    Frederick Townes

    (@fredericktownes)

    There’s actually a different approach that I’d like to take entirely. Can we talk offline about it? Please hit me up via my contact form: http://www.w3-edge.com/contact/

    Scott Winterroth

    (@countrymusicchicago)

    I hope you two are able to address this as I’m way over my head but really need better mobile options with W3TC.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘W3 Total Cache and WordPress Mobile Pack’ is closed to new replies.