Learn about Centmin Mod LEMP Stack today
Register Now

Beta Branch part 2 prep work fastcgi_cache support to centmin.sh menu option 22

Discussion in 'Centmin Mod Github Commits' started by eva2000, Nov 1, 2018.

  1. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    part 2 prep work fastcgi_cache support to centmin.sh menu option 22

    Further work on centmin.sh menu option 22 fastcgi_cache support which is currently disable by default out of the box until further testing is done. For test server testing only you can enable the current version of fastcgi_cache support via persistent config file /etc/centminmod/custom_config.inc set variable WP_FASTCGI_CACHE='y' prior to launch centmin.sh menu option 22. There are a few auto created include files to allow your own custom settings to persistent when you select fastcgi_cache as caching method for centmin.sh menu option 22 installed wordpress including:

    within nginx.conf include file /usr/local/nginx/conf/wpfastcgi_cache_path_includes.conf for setting up fastcgi_cache_path directive and parameters

    within nginx.conf include file /usr/local/nginx/conf/wpfastcgi_cache_map.conf there are the following:
    • /usr/local/nginx/conf/wpfastcgi_cache_map_include_mobile.conf - to set your own custom mobile user agents to exclude from cache
    • /usr/local/nginx/conf/wpfastcgi_cache_map_include_nocachecookie.conf - to set your own cookies to exclude from cache. Example setting would exclude from fastcgi_cache cookie named cookiename
      Code (Text):
      ~*cookiename                   1;
      
    • /usr/local/nginx/conf/wpfastcgi_cache_map_include_nocacheuri.conf - to set your own urls to exclude from cache. Example setting would exclude from fastcgi_cache urls beginning with /privatedir
      Code (Text):
      ~^/privatedir                   1;
      
    • /usr/local/nginx/conf/wpfastcgi_cache_map_debug.conf - to set IP addresses for ISP and server to reveal other diagnostic headers that are hidden from users not whitelisted in this file. Example
      Code (Text):
      YOURISP_IPADDRESS 1;
      YOURSERVER_IPADDRESS 1;
      

      This will whitelist and allow specified IP addresses to view additional headers for X-Processing-Time, X-Request-ID and X-FPM-Cache (HIT/MISS/BYPASS) for fastcgi_cached resources. So when you run curl from same server the server IP address is whitelisted and allowed to show these additional headers which are hiddent to other regular visitors.
      Code (Text):
      curl -I http://wpfc.domain.com/
      HTTP/1.1 200 OK
      Date: Thu, 01 Nov 2018 07:40:52 GMT
      Content-Type: text/html; charset=UTF-8
      Connection: keep-alive
      Vary: Accept-Encoding
      Link: <http://wpfc.domain.com/wp-json/>; rel="https://api.w.org/"
      Server: nginx centminmod
      X-Powered-By: centminmod
      X-Processing-Time: 0.000
      X-Request-ID: 19ba59412d4b56ab725b1ca11f228f10
      X-FPM-Cache: HIT
      
    within wordpress nginx site vhost config file /usr/local/nginx/conf/php.conf include file is replaced with fastcgi_cache version that is unique to each site domain vhost name i.e. /usr/local/nginx/conf/wpincludes/domain.com/php-fastcgicache.conf

    within wordpress nginx site vhost config file include file /usr/local/nginx/conf/wpincludes/domain.com/wpfastcgicache_include_domain.com.conf is added for general fastcgi_cache settings

    This is very early development work so code and logic may change in future as more testing is done.

    Continue reading...

    123.09beta01 branch
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Code (Text):
    Default is to install KeyCDN WP Cache Enabler Plugin as it is more
    stable and reliable than WP Super Cache and Redis Cache.
    Redis cache may have issues with caching due to long 6hr cache TTL
    Fastcgi_cache (PHP-FPM) will have best performance
    You can select which caching method to use below:
    
    --------------------------------------------------------
            Wordpress Caching               
    --------------------------------------------------------
    1). KeyCDN Cache Enabler (default & recommended)
    2). Redis Nginx Level Caching (may have issues with some wp plugins)
    3). Wordpress Super Cache
    4). Fastcgi_cache (PHP-FPM)
    --------------------------------------------------------
    Enter option [ 1 - 4 ] 4
    
     
  3. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  4. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  5. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  6. fabianski

    fabianski Member

    102
    13
    18
    Feb 20, 2019
    Brazil
    Ratings:
    +35
    Local Time:
    4:35 AM
    any news about working with the fastcgi cache? I am anxious for this to be released
     
  7. eva2000

    eva2000 Administrator Staff Member

    41,742
    9,398
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,439
    Local Time:
    5:35 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x