Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch update centmin.sh menu option 22 cache enabler cache config in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Aug 26, 2020.

  1. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,839
    Local Time:
    2:27 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    update centmin.sh menu option 22 cache enabler cache config in 123.09beta01

    - Update centmin.sh menu option 22 wordpress installer's Cache Enabler config to support caching/stripping of query strings for fbclid, gclid and utm
    - Existing Wordpress sites won't automatically be updated, so you'd have to run cmupdate command and then do it manually as outlined in this post Wordpress - Ensuring urls with utm params, fbclid, adwords params are served from cache for existing Wordpress vhosts and include file
    - New Wordpress sites will have this update by default

    Continue reading...

    123.09beta01 branch


     
  2. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,839
    Local Time:
    2:27 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    This update is for centmin.sh menu option 22 Wordpress Nginx installer's Cache Enabler configuration and will strip query strings like ?fbclid, ?gclid and ?utm defined in map $args to $q_ignorearg via 302 redirect in /usr/local/nginx/conf/wpcacheenabler_map.conf

    contents of /usr/local/nginx/conf/wpcacheenabler_map.conf
    Code (Text):
    map $http_user_agent $cmwpcache_device {
       default                                     'desktop';
       ~*(iPad|iPhone|Android|IEMobile|Blackberry) 'mobile';
       "~*Firefox.*Mobile"                         'mobile';
       "~*ipod.*mobile"                            'mobile';
       "~*Opera\ Mini"                             'mobile';
       "~*Opera\ Mobile"                           'mobile';
       "~*Mobile"                                  'mobile';
       "~*Tablet"                                  'mobile';
       "~*Kindle"                                  'mobile';
       "~*Windows\ Phone"                          'mobile';
    }
    
    map $args $q_ignorearg {
      default                 0;
      "~*fbclid"            1;
      "~*gclid"             1;
      "~*utm"               1;
      "~*fb_action_ids"     1;
      "~*fb_action_types"   1;
      "~*fb_source"         1;
      "~*age-verified"      1;
      "~*ao_noptimize"      1;
      "~*usqp"              1;
      "~*cn-reloaded"       1;
      "~*_ga"               1;
      "~*_ke"               1;
    }
    

    Curl header checks for the 302 redirect to defined Location stripped of the query string
    Code (Text):
    curl -I http://cache-enabler.domain.com/?fbclid
    HTTP/1.1 302 Moved Temporarily
    Date: Wed, 26 Aug 2020 12:59:44 GMT
    Content-Type: text/html
    Content-Length: 138
    Location: http://cache-enabler.domain.com/
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    Set-Uri: nullcache
    

    Code (Text):
    curl -I http://cache-enabler.domain.com/?gclid
    HTTP/1.1 302 Moved Temporarily
    Date: Wed, 26 Aug 2020 12:50:07 GMT
    Content-Type: text/html
    Content-Length: 138
    Location: http://cache-enabler.domain.com/
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    Set-Uri: nullcache
    

    Code (Text):
    curl -I http://cache-enabler.domain.com/?utm
    HTTP/1.1 302 Moved Temporarily
    Date: Wed, 26 Aug 2020 12:50:12 GMT
    Content-Type: text/html
    Content-Length: 138
    Location: http://cache-enabler.domain.com/
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    Set-Uri: nullcache
    

    wrk load test
    Code (Text):
    wrk-cmm -t4 -c50 -d5s --latency --breakout http://cache-enabler.domain.com/?gclid
    Running 5s test @ http://cache-enabler.domain.com/?gclid
      4 threads and 50 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency   610.19us    1.61ms  37.39ms   93.47%
        Connect   176.25us   84.89us 337.00us   62.50%
        TTFB      607.10us    1.61ms  37.39ms   93.47%
        TTLB        1.90us   13.49us   5.01ms   99.99%
        Req/Sec    44.14k    13.16k   81.15k    65.67%
      Latency Distribution
         50%  182.00us
         75%  341.00us
         90%    1.13ms
         95%    3.04ms
         99%    7.80ms
      883043 requests in 5.10s, 388.22MB read
    Requests/sec: 173190.48
    Transfer/sec:     76.14MB
    

    Code (Text):
    wrk-cmm -t4 -c50 -d5s --latency --breakout http://cache-enabler.domain.com/?fbclid
    Running 5s test @ http://cache-enabler.domain.com/?fbclid
      4 threads and 50 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency     1.17ms    5.16ms  90.48ms   96.32%
        Connect     1.13ms    0.96ms   3.45ms   63.39%
        TTFB        1.17ms    5.16ms  90.48ms   96.32%
        TTLB        1.97us   26.28us   7.88ms   99.99%
        Req/Sec    42.86k    13.12k   66.46k    58.50%
      Latency Distribution
         50%  179.00us
         75%  381.00us
         90%    1.44ms
         95%    4.59ms
         99%   24.79ms
      854923 requests in 5.03s, 375.86MB read
    Requests/sec: 170129.87
    Transfer/sec:     74.80MB
    

    Code (Text):
    wrk-cmm -t4 -c50 -d5s --latency --breakout http://cache-enabler.domain.com/?utm                            
    Running 5s test @ http://cache-enabler.domain.com/?utm
      4 threads and 50 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency   838.50us    3.99ms  83.77ms   96.80%
        Connect   186.48us   89.73us 348.00us   62.50%
        TTFB      835.26us    3.99ms  83.76ms   96.80%
        TTLB        2.01us   31.77us   9.01ms   99.99%
        Req/Sec    43.97k    14.27k   84.01k    63.18%
      Latency Distribution
         50%  177.00us
         75%  357.00us
         90%  753.00us
         95%    2.57ms
         99%   15.19ms
      880017 requests in 5.10s, 386.89MB read
    Requests/sec: 172567.75
    Transfer/sec:     75.87MB
    
     
    Last edited: Sep 5, 2020