Want to subscribe to topics you're interested in?
Become a Member

Wordpress Disable mobile caching once enabled?

Discussion in 'Blogs & CMS usage' started by joshuah, Nov 23, 2017.

  1. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    2:56 AM
    Is it possible to disable the mobile caching once a website is setup under option 22?
     
  2. eva2000

    eva2000 Administrator Staff Member

    43,482
    9,870
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,243
    Local Time:
    1:56 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    To disable mobile cache you need to edit the include files for your selected wordpress caching include file

    where ${vhostname} is your domain.com name

    for keycdn cache enabler would be at /usr/local/nginx/conf/wpincludes/${vhostname}/wpcacheenabler_${vhostname}.conf so uncomment and remove hash # in front of 2nd line and restart nginx + php-fpm so looks like below
    Code (Text):
        # exclude mobile devices from redis caching
        if ($cmwpcache_device = mobile) { set $cache_uri 'nullcache'; }
    

    for redis nginx level cache would be at /usr/local/nginx/conf/wpincludes/${vhostname}/rediscache_${vhostname}.conf so uncomment and remove hash # in front of 2nd line and restart nginx + php-fpm so looks like below
    Code (Text):
    # exclude mobile devices from redis caching
    if ($redis_device = mobile) { set $skip_cache 1; }
    

    for wp super cache there doesn't seem to be a mobile cache setup configured
     
    • Informative Informative x 1
  3. runos

    runos Member

    42
    13
    8
    Dec 17, 2019
    Ratings:
    +16
    Local Time:
    11:56 PM
    1.17.6
    10
    What if I want to ENABLE mobile caching after I disable it during wordpress routine 22 setup?
    Thanks!
     
  4. eva2000

    eva2000 Administrator Staff Member

    43,482
    9,870
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,243
    Local Time:
    1:56 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    you'd do the opposite and comment out the above lines with hash # in front and restart nginx and php-fpm
    Code (Text):
       # exclude mobile devices from redis caching
       #if ($cmwpcache_device = mobile) { set $cache_uri 'nullcache'; }
    
     
  5. runos

    runos Member

    42
    13
    8
    Dec 17, 2019
    Ratings:
    +16
    Local Time:
    11:56 PM
    1.17.6
    10
    Got it! Thanks :)