Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I think this is expected, as the point of caching is to serve HTML instead of processing the server every request.

    Thread Starter anwaar

    (@anwaar)

    hi so what is the alternate or solution of this issue ?

    Moderator bcworkz

    (@bcworkz)

    wp_is_mobile() works by checking the supplied user agent for tell tale elements of mobile browsers. Either the pages using this need to be reconfigured so they work for all browsers (which is ideal), or do not cache such pages, or have a non-cached script which redirects to the appropriate cached version (probably least ideal, and depending on caching scheme, impractical).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_is_mobile not working sometimes’ is closed to new replies.