Learn about Centmin Mod LEMP Stack today
Register Now

Wordpress Correct WP Cache Contents?

Discussion in 'Blogs & CMS usage' started by rdan, Jul 5, 2015.

Tags:
  1. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    9:03 AM
    Mainline
    10.2
    Right now I got this stats:
    upload_2015-7-5_1-25-56.png

    So "Use mod_rewrite to serve cache files" is not working as intended?
    I thought cache must be on "WP-Super-Cache".
    Right now, 99% of my cache serve by WP-Cache.

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that's normal i think WordPress › WP Super Cache « WordPress Plugins

    check how source code for cached by footer comments
    also see troubleshooting part to double check
     
  3. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    9:03 AM
    Mainline
    10.2
    Yeah I'm seeing this header:
    WP-Super-Cache: Served legacy cache file
     
  4. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    9:03 AM
    Mainline
    10.2
    By the way, I fixed it already :).
    upload_2015-7-17_15-37-19.png
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nice and fix ?
     
  6. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    9:03 AM
    Mainline
    10.2
    On WP domain conf:
    Need to add this on php.conf specific to WP only using WP-Super-cache:
     
  7. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  8. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    9:03 AM
    Mainline
    10.2
    But with $http_host; value.
    And it's use on WP cache:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
     
  9. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh i see ! need to update my info/installer :D
     
  10. ivanc82

    ivanc82 New Member

    27
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:03 AM
    1.11.4
    MariaDB 10
    Hi eva2000,

    i followed everything but still not able to get WP Super Cache working. It shows still WP-Super-Cache: Served legacy cache file headers.
     
  11. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    What does your domain's nginx vhost contents look like ?

    When you create a new nginx vhost domain via centmin.sh menu option 2 or /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags | Centmin Mod Community

    Also do you have permalinks enabled ?
     
  12. ivanc82

    ivanc82 New Member

    27
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:03 AM
    1.11.4
    MariaDB 10
    Here my vhost content and i have permalinks enabled. --> /%category%/%postname%/

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name edmdroid.com;
    #            return 301 $scheme://www.edmdroid.com$request_uri;
    #       }
    
    server {
    server_name edmdroid.com www.edmdroid.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
    # limit_conn limit_per_ip 16;
    # ssi on;
    
    access_log /home/nginx/domains/edmdroid.com/log/access.log combined buffer=256k flush=60s;
    error_log /home/nginx/domains/edmdroid.com/log/error.log;
    
    root /home/nginx/domains/edmdroid.com/public;
    
      # prevent access to ./directories and files
      location ~ (?:^|/)\. {
       deny all;
      }
    
    include /usr/local/nginx/conf/wpsupercache_edmdroid.com.conf;
    
    location / {
    # Enables directory listings when index file not found
    #autoindex on;
    
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
    
    }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/edmdroid.com/htpasswd_wplogin;   
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwplogin burst=2 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
    include /home/nginx/domains/edmdroid.com/conf/rewrite.conf;
    #include /usr/local/nginx/conf/wpsecure_edmdroid.com.conf;
    include /usr/local/nginx/conf/php-wpsc.conf;
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    }
     
  13. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    this part is wrong
    Code:
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
    needs to be
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
    #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
    restart nginx and php-fpm
    Code:
    nprestart
    then try re-enabling wp super cache from wp admin sometimes settings are cached
     
  14. ivanc82

    ivanc82 New Member

    27
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:03 AM
    1.11.4
    MariaDB 10
    for the /cache/supercache/domainname.com/ and all its subfolders need to have index.html inside or just folders without file?
     
  15. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    out of box it doesn't have it.. unless you have populated wp super cache then it auto creates index.html when you access the index page of your wp install

    why you ask ? it won't cause WP Super cache to not work
     
  16. ivanc82

    ivanc82 New Member

    27
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:03 AM
    1.11.4
    MariaDB 10
    okay got it..
     
  17. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah example after i access index page of my wp super cache enabled site
    Code:
    ls -lah wp-content/cache/supercache/domain.com/
    total 40K
    drwxrwsrwx 2 nginx nginx 4.0K Dec  1 13:28 .
    drwxrwsrwx 3 nginx nginx 4.0K Nov 19 09:31 ..
    -rw-r--r-- 1 nginx nginx  22K Dec  1 13:28 index.html
    -rw-r--r-- 1 nginx nginx 4.5K Dec  1 13:28 index.html.gz
     
  18. ivanc82

    ivanc82 New Member

    27
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:03 AM
    1.11.4
    MariaDB 10
    i see.. okay..
    one thing i noticed is the WP Super Cache shows

    WP-Super-Cache (0KB)
    • 0 Cached Pages
    • 0 Expired Pages
    any idea how to fix?
     
  19. eva2000

    eva2000 Administrator Staff Member

    55,209
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    11:03 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+