Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    This is outside the control of the mobile detect module – it depends on the cache plugin that you’re using. Some of them have a feature to detect user devices.

    It is possible to cache the pages manually like this:

    [is mobile]
      [cache name="mobile_page" expires="1 day"]
        ...content for mobile..
      [/cache]
    [else]
      [cache name="non_mobile_page" expires="1 day"]
        ...content for non-mobile..
      [/cache]
    [/is]
    Thread Starter Viktor Szépe

    (@szepeviktor)

    Thank you!

    Could it be that the cache shortcode has no reference tab?
    /options-general.php?page=ccs_reference&tab=cache

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    Currently the only way to see the reference page for [cache] is from the Overview. So the tab exists, but not easy to find.. It’s actually the same for the new [block] shortcodes I added, you can only reach the documentation from the Overview or Settings page. I’ve been thinking how to solve this – right now, there is maximum number of visible tabs that fit horizontally. So, I need a different way to organize the reference sections.

    About mobile detect and caching: I recently had the same issue – in one project I was using mobile detect to serve different layouts, but any caching plugin would cache the page before the device detection, and only served the same cached page for all visitors.

    So, server-side device detection doesn’t work with most caching plugins – some provide a way around it. In my case, I had to use client-side detection using JavaScript, which comes after the cached page is loaded.

    Another way to achieve mobile detect and caching, is to manually cache page sections, as suggested above. It depends on the use case, if this is a practical thing to do. If you have any suggestions to improve this, please let me know.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Moblie detect’ is closed to new replies.