• Hello,
    I have a responsive website. For Mobile, On some posts, it shows adsense, some it doesn’t. I understand that if it shows blank box, means it’s error from adsense due to the size issue. But, for the most part, I don’t see unit loaded at all. no blank space or anything. Should there be any issue in this?

    Thanks

    • This topic was modified 7 years, 5 months ago by zvhipp.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support LiteSpeed Lisa

    (@lclarke)

    Hi, @zvhipp

    Apologies for the delay in responding to this. I am not sure what could be causing your issue, but I have one thing you could check:

    Do you have Cache Mobile set to ON in LiteSpeed Cache > Settings > Cache? If your site has a responsive design, you don’t need to cache a separate mobile view. Set it to OFF and see if the problem persists.

    Let us know if that doesn’t solve the problem!

    Thread Starter zvhipp

    (@zvhipp)

    Thank you for your reply. I tried turning it off, but it didn’t help much, I will keep playing with the settings and javascript. Some pages I noticed text/html cache was set for 31 days in .htaccess. I updated it with 0.

    One question I had was, I use wp_is_mobile to display little different things just for mobile visitors. This was the reason I had enabled separate mobile view even though I have a responsive website. If I turn it off, then due to caching based on the device the page was accessed from, It displayed mobile only part on the desktop too and did opposite on mobile too.

    Will wp_is_mobile be reliable with mobile cache enabled?

    Thanks.

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    Hi, @zvhipp

    It looks you have a browser cache directive in .htaccess interfering with LiteSpeed Cache.

    Change the line as follows:

    ExpiresByType text/html "access plus 0 seconds"

    That will stop the browser from caching your site’s pages and leave the caching to LSCWP. That, plus the advice I gave earlier about turning off Cache Mobile, should fix the problem. If not, let me know!

    BTW, that .htaccess directive was probably added by another cache plugin. If you are currently running two cache plugins at once, it is a good idea to disable the other one, as it may be causing unpredictable behavior.

    As far as wp_is_mobile, I am afraid I don’t know the answer to that question.

    @hailite, can you help?

    • This reply was modified 7 years, 5 months ago by LiteSpeed Lisa. Reason: Fixed formatting
    • This reply was modified 7 years, 5 months ago by LiteSpeed Lisa.

    Hi @lclarke @hailite,

    We are having this wp_is_mobile issue with LSCache aswell.

    I have also tried with ExpiresByType text/html “access plus 0 seconds”
    And also with Turning ON/OFF Separate Mobile Cache.

    Every time the headers send “hit” inside “x-litespeed-cache” along with the website, Desktop version loads on Mobile instead of Mobile number. Mobile Cache is either not being stored, or never loads. Everytime LSCache is hit, Only Desktop version is loaded.

    We are using OpenLitespeed, I’ve also created a report – QWQLMHUC.

    • This reply was modified 6 years, 11 months ago by BaseZap.
    Plugin Support LiteSpeed Lisa

    (@lclarke)

    Hi, @basezap

    LSCache should work with wp_is_mobile, and you should have Cache Mobile set to ON.

    If you are able to create template files, you can test it easily.

    Create test.php in your theme’s directory and place this in the file:

    
    <?php
    /**
     * Template Name: Test page
     *
     */
    get_header();
    
    echo date( 'Y-m-d H:i:s' ) ;
    
    if ( wp_is_mobile() ) {
        echo "<h2>Is mobile</h2>" ;
    }
    else {
        echo "<h2>This is not mobile</h2>" ;
    }
    

    Then, create a page in WP Admin that uses this template.

    You should be able to clearly see which version is being served when you view the new page on Desktop or Mobile.

    Let us know how this test goes on your site, and we’ll see if we have more troubleshooting to do after that.

    Hi @lclarke,

    I am trying this now and setting up a test environment. We will continue this on the ticket I’ve created on [email protected], under the Ticket ID – 987121 . Request you to help us there.

    We’ll post the final outcome and solution here.

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    Sounds good!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Should wp_is_mobile work propery with mobile cache?’ is closed to new replies.