Want more timely Centmin Mod News Updates?
Become a Member

Excluding URLs from SuperCache

Discussion in 'Blogs & CMS usage' started by wlin, Apr 10, 2016.

  1. wlin

    wlin New Member

    9
    1
    3
    Apr 10, 2016
    Ratings:
    +1
    Local Time:
    11:34 AM
    Hi. Trying to avoid caching certain pages (e.g. /add-a-quote/), I've added that string in the exclusions list under WP-SuperCache Advanced. I've also added this to the nginx server config:

    if ($request_uri ~* "(/add-a-quote|/random-story|/contact-form|/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
    set $cache_uri 'null cache';
    }


    But it still keeps caching that page. Any ideas?
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    4:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    did you clear cache and restart nginx and php-fpm ?
     
  3. wlin

    wlin New Member

    9
    1
    3
    Apr 10, 2016
    Ratings:
    +1
    Local Time:
    11:34 AM
    Yes I've tried that.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    4:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. wlin

    wlin New Member

    9
    1
    3
    Apr 10, 2016
    Ratings:
    +1
    Local Time:
    11:34 AM
    OK I figured it's because my URLs are having the / removed at the end.

    So loading the site with /add-a-quote causes it to cache. Loading the site with /add-a-quote/ causes it to not cache. Is it supposed to have a slash at the end automatically?

    Also does this mean the Supercache settings Wordpress side for rejected URIs dont work? Everything is set in nginx config?
     
    Last edited: Apr 22, 2016
  6. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    4:34 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    add forward slash to these
    Code (Text):
    /add-a-quote|/random-story|/contact-form