• Resolved netconsulting

    (@netconsulting)


    Hi there,

    Great plugin. We only have a small problem.

    On line 396 and line 512 (AMP) you check if the web is viewed on a mobile device (via PHP code):
    if (wp_is_mobile() ) {echo "api";} else {echo "web";}
    and choose the protocol accorging to the device.

    We are facing problems with cache plugins as they cache this check and normally the cached URL is always the web.whatsapp.com URL so that on a mobile device the link is not opened in the Whatsapp APP but in the browser (asking for web login).

    Any idea how to solve this? In order to avoid cache plugin issues this check should be done in Javascript but we really don’t know how exactly.

    Thanks for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @netconsulting
    This is a very commom issue and you don’t need any javascript to solve that.
    Usally cache plugins have a option to enable a diferent cache for mobile. I’ll give you a example how it appears in litespeed cache (follow the screenshoot bellow).

    I’m prety sure wp-rocket and w3tc also has that option.
    I?f? ?y?o?u? ?d?o?n?’?t? ?h?a?v?e? ?t?h?a?t? ?o?p?t?i?o?n? ?y?o?u? ?s?h?o?u?l?d? ?c?o?n?s?i?d?e?r? ?c?h?a?n?g?e? ?y?o?u?r? ?p?l?u?g?i?n? =)

    Second option would be disable your mobile cache (I do not recommend that option if you are not using amp).
    You can disable only for specific agents like Android…

    https://caporalmktdigital.d.pr/6kYBLj

    Make sure you clear all cache (specially object cache) and your browser cache to run another test.

    That’s it!
    Hope it helps…

    Thread Starter netconsulting

    (@netconsulting)

    Thanks!!!! We just activated the mobile cache at WP ROCKET. We didn’t think of this solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with cache plugin and check for mobile device’ is closed to new replies.