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

Master Branch update wordpress cache enabler include template in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Sep 16, 2020 at 8:42 AM.

  1. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    10:48 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    update wordpress cache enabler include template in 123.09beta01

    - Update centmin.sh menu option 22 wordpress cache enabler include template at /usr/local/nginx/conf/wpincludes/${vhostname}/wpcacheenabler_${vhostname}.conf where ${vhostname} is yourdomain.com. For new centmin.sh menu option 22 Wordpress installs only, add at bottom optional browser cache TTL directive commented out/disabled directives. This sets web browser cache to 120 seconds – adjust accordingly to your own needs.

    #if (-f $document_root$cache_enabler_uri) {
    # set $cttls "120s";
    #}
    #expires $cttls;

    to enable, uncomment and remove hash # in front of the 4 lines

    if (-f $document_root$cache_enabler_uri) {
    set $cttls "120s";
    }
    expires $cttls;

    Then restart Nginx. This will set expires header and Cache Control header to max-age=120 only when Cache Enabler cached files exist on disk.

    - Existing Wordpress cache enabler installs will need to manually add this themselves.
    - If you're behind Cloudflare, you will need to in Cloudflare site zone’s dashboard on Caching > Configuration section set Browser Cache TTL to ‘Respect Existing Headers’ or set it via custom Cloudflare Page Rule if you only want to apply it to a specific subdomain or path. Otherwise, Cloudflare's default Browser cache TTL value might come into play or override your set value.

    Continue reading...

    Centmin Mod Github Master branch

    Master branch is where most recent commits are made as at May 24, 2015.