Support » Plugin: Jetpack by WordPress.com » jetpack_is_mobile not working behind reverse proxy

  • Resolved as8564

    (@as8564)


    Hi ,

    We are using a bunch of reverse proxy and understand for jetpack_is_mobile to work vary headers for user-agent should get passed. Even if we pass the vary headers why we would create so many cache copies for each user agent ? Also found out few CDN vendors do not cache the response based on device types or user-agents.

    Major Issue : User-agent and adaptive code execution check should be on frontend (through JS) rather then the backend or an optional check between the two.

    https://wordpress.org/plugins/jetpack/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Even if we pass the vary headers why we would create so many cache copies for each user agent ?

    You don’t have to cache every user agent. You could choose to only care about a few specific agents (the most popular ones, for example) and return nothing for all other User Agents. If $_SERVER['HTTP_USER_AGENT'] is empty, Jetpack won’t consider them as coming from a mobile device.

    Does this help?

    User-agent and adaptive code execution check should be on frontend (through JS) rather then the backend or an optional check between the two.

    Were you thinking about something like Modernizr? The main problem with checking User Agent on the frontend is that you have to wait until the DOM is loaded to find out what device the person is using. In some cases, like for Jetpack’s Mobile Theme, that is too late; we need to know the device before the page is loaded.

    Do you know of any alternative that would allow us to get around that problem?

Viewing 1 replies (of 1 total)
  • The topic ‘jetpack_is_mobile not working behind reverse proxy’ is closed to new replies.