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:
    6:16 PM
    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

    30,838
    6,903
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,393
    Local Time:
    12:16 PM
    Nginx 1.13.x
    MariaDB 5.5
    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:
    6:16 PM
    Yes I've tried that.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,838
    6,903
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,393
    Local Time:
    12:16 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. wlin

    wlin New Member

    9
    1
    3
    Apr 10, 2016
    Ratings:
    +1
    Local Time:
    6:16 PM
    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

    30,838
    6,903
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,393
    Local Time:
    12:16 PM
    Nginx 1.13.x
    MariaDB 5.5
    add forward slash to these
    Code (Text):
    /add-a-quote|/random-story|/contact-form