• Resolved popac

    (@popac)


    Web site is frequently updated with new content
    The server is dedicated
    Ubuntu 16.04.5 LTS
    PHP 7.2.7-1
    nginx version: nginx/1.13.12
    Cloudflare
    SSL enabled – Full

    When I turn on Page cache with “Cache SSL (HTTPS) requests” (SELECTED – ON) have problem.
    When I create new posts for site visitors who have already been on the site, the old content is displayed – the browser will not show the new content.

    View post on imgur.com

    I tried to setup Purge Policy options (Front Page, Post Page and Blog Feed) but nothing happened.

    When deselect Cache SSL (HTTPS) requests, all is OK.

    Of course, I want to use this option, since it significantly reduces the server load. Do you know what the problem is?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,

    If you try hard reload Ctrl+F5 do you have new content displayed?
    What settings do you have in Browser Cache?
    Make sure that your nginx.conf is updated properly. Check Performance>Install.

    Thread Starter popac

    (@popac)

    Hi Marko,
    Tried hard reload with Ctrl+F5 without success.
    Browser cache is ON: All default settings.
    Nginx is updated – I have root access to server and I can restart whenever I need it (make changes).

    nginx.conf
    =====================
    # BEGIN W3TC Page Cache core
    set $w3tc_rewrite 1;
    if ($request_method = POST) {
    set $w3tc_rewrite 0;
    }
    if ($query_string != “”) {
    set $w3tc_rewrite 0;
    }
    if ($http_cookie ~* “(comment_author|wp\-postpass|wordpress_logged_in|wptouch_switch_toggle)”) {
    set $w3tc_rewrite 0;
    }
    set $w3tc_preview “”;
    if ($http_cookie ~* “(w3tc_preview)”) {
    set $w3tc_preview _preview;
    }
    set $w3tc_ssl “”;
    if ($scheme = https) {
    set $w3tc_ssl _ssl;
    }
    if ($http_x_forwarded_proto = ‘https’) {
    set $w3tc_ssl _ssl;
    }
    set $w3tc_enc “”;
    if ($http_accept_encoding ~ gzip) {
    set $w3tc_enc _gzip;
    }
    # END W3TC Page Cache core
    # BEGIN W3TC Browser Cache
    gzip on;
    gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon image/webp application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel;
    location ~ \.(css|htc|less|js|js2|js3|js4)$ {
    expires 31536000s;
    etag on;
    if_modified_since exact;
    add_header Pragma “public”;
    add_header Cache-Control “public”;
    add_header X-Powered-By “W3 Total Cache/0.9.7.2”;
    try_files $uri $uri/ $uri.html /index.php?$args;
    }
    location ~ \.(html|htm|rtf|rtx|svg|txt|xsd|xsl|xml)$ {
    expires 10000s;
    etag on;
    if_modified_since exact;
    add_header Pragma “public”;
    add_header Cache-Control “public”;
    add_header X-Powered-By “W3 Total Cache/0.9.7.2”;
    try_files $uri $uri/ $uri.html /index.php?$args;
    }
    location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip)$ {
    expires 31536000s;
    etag on;
    if_modified_since exact;
    add_header Pragma “public”;
    add_header Cache-Control “public”;
    add_header X-Powered-By “W3 Total Cache/0.9.7.2”;
    try_files $uri $uri/ $uri.html /index.php?$args;
    }
    add_header Referrer-Policy “”;
    # END W3TC Browser Cache
    =============================

    Thread Starter popac

    (@popac)

    I forgot to add, I use Memcached (1.2.2) Page Cache Method

    Thread Starter popac

    (@popac)

    I finally came up with a solution that works:

    Page Cache settings:

    View post on imgur.com

    When I publish new post, it is important to have refreshed front page, category page, and single (post ) page. Everything works great.

    Browser cache is ON and settings is:

    View post on imgur.com

    the result is very little load on the server:

    CPU load averages 1.23 (1 min) 1.31 (5 mins) 1.36 (15 mins)

    Here’s nginx status:

    Active connections: 165
    server accepts handled requests
    884864 884864 900788
    Reading: 0 Writing: 2 Waiting: 139

    Memcached:

    NAME                                      SIZE   %MEM    TIME  CONN   %HIT   REQ/s   GET/s   SET/s   DEL/s   EVI/s     READ/s   WRITE/s
    127.0.0.1:11211                         2.0 Gb   27.0    1 ms   206   72.4   567.6   360.2   207.4     0.0     0.0   415.8 Kb  359.7 Kb
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    Just the matter of settings tweaking.
    Glad to know that the issue is resolved!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page Cache + Cache SSL (HTTPS) requests – not working’ is closed to new replies.