Join the community today
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:
    5:20 AM
    Is it possible to disable the mobile caching once a website is setup under option 22?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,584
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    4:20 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  3. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    2:20 AM
    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

    54,584
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    4:20 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    2:20 AM
    1.17.6
    10
    Got it! Thanks :)