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

Wordpress fastcgi-cache setup

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Matt Williams, Apr 12, 2022.

  1. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
  2. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
    I'm also wondering if you have any test results for FastCGI-Cache and Redis? Couldn't find any but I'm sure they are around here somewhere...
     
  3. cloud9

    cloud9 Premium Member Premium Member

    431
    117
    43
    Oct 6, 2015
    England
    Ratings:
    +217
    Local Time:
    10:34 PM
    1.25.3
    10.6.x
  4. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    8:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    No need to follow the linked URL, centmin.sh menu option 22 with WP_FASTCGI_CACHE='y' in the persistent config file already does all the Nginx side setup and configuration. For performance out of the box, PHP-FPM fastcgi_cache full HTML page cache will be slightly faster than Redis cache Nginx level full HTML page cache but really wouldn't be much of a difference.
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
    @cloud9 I have not read that. Thank you for pointing that article out. Much appreciated!
    Next question, in order to setup redis to cache the database, I would need to add the following to my wp-config file:

    Code:
    /** REDIS DATABASE CACHE SETTING */
    
    define( 'WP_REDIS_HOST', '127.0.0.1' );
    define( 'WP_REDIS_PORT', 6379 );
    define( 'WP_REDIS_DATABASE', 2 );
    define( 'WP_REDIS_TIMEOUT', 2 );
    define( 'WP_REDIS_READ_TIMEOUT', 2 );
    define( 'WP_REDIS_MAXTTL', 3600 );
    and install the redis plugin?

    So I would have fastcgi-cache to do full page caching and redis to cache the database. Is this the correct setup?
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    8:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yup that works fine with those settings IIRC :)
     
  7. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
  8. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
    Last edited: Apr 14, 2022
  9. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    8:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    centmin.sh menu option 22 fastcgi_cache method already excludes admin from caching so should work out of the box unless you are implementing fastcgi_cache yourself and not using centmin.sh menu option 22. All centmin.sh menu option 22 Wordpress auto installer's guest full HTML page caching options offered do exclude admin side caching out of the box.
     
  10. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    5:34 PM
    latest
    10
    So it most likely is Redis then. Any way to eliminate the wp admin from redis cache?
     
  11. eva2000

    eva2000 Administrator Staff Member

    54,647
    12,230
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,799
    Local Time:
    8:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    As stated above, centmin.sh menu option 22 Wordpress cache option for Redis Nginx cache or Cache-enabler based full HTML page caching also excludes WP Admin from respective cache by default.