Learn about Centmin Mod LEMP Stack today
Register Now

Beta Branch update wordpress cache enabler include template in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Sep 9, 2020.

  1. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    6:00 PM
    Nginx 1.21.x
    MariaDB 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.

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

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

    Code (Text):
    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...

    123.09beta01 branch