Skip to main content

Server Cache Exclusions

GridPane applies default cache exclusions automatically, but custom exclusions can be added when needed.

Default Exclusions

Automatically Bypassed

  • Query strings - Any URL with ?param=value
  • POST requests - Form submissions and data posts
  • Logged-in users - WordPress admin/authenticated sessions

Excluded URIs

PatternPurpose
/wp-admin/Admin dashboard
/xmlrpc.phpXML-RPC API
*.phpPHP files
/feed/RSS feeds
*sitemap*.xmlSitemaps

WooCommerce/EDD Pages

  • /cart/
  • /checkout/
  • /my-account/
  • /store*
  • /addons

Cookies That Bypass Cache

  • wordpress_logged_in
  • wordpress_no_cache
  • wp-postpass
  • comment_author
  • woocommerce_cart_hash
  • woocommerce_items_in_cart
  • edd_items_in_cart

Custom Exclusions

Add exclusions via Nginx config files:

  • Redis cache: /var/www/site.url/nginx/custom-skip-redis-cache-context.conf
  • FastCGI cache: /var/www/site.url/nginx/custom-skip-fcgi-cache-context.conf

Exclude Single Page

if ($request_uri ~* "(/example-page/)") {
set $skip_cache 1;
set $skip_reason "${skip_reason}-request_uri";
}

Exclude Multiple Pages

if ($request_uri ~* "(/page-one/|/page-two/|/page-three/)") {
set $skip_cache 1;
set $skip_reason "${skip_reason}-request_uri";
}

Exclude Parent + Child Pages (Wildcard)

if ($request_uri ~* "(/parent-page.*)") {
set $skip_cache 1;
set $skip_reason "${skip_reason}-request_uri";
}

Exclude Homepage

if ($request_uri ~ ^/$) {
set $skip_cache 1;
set $skip_reason "${skip_reason}-request_uri";
}
if ($http_cookie ~* "cookie_name") {
set $skip_cache 1;
set $skip_reason "${skip_reason}-your_cookie";
}

Example: Excluding a Live Inventory Page

A client has a car dealership site at dealership.com using Redis cache. Their /inventory/ page pulls live vehicle data from a third-party API, but visitors see stale results due to caching.

Step 1: Connect via Termius

Open Termius and connect to the server using your SSH key.

Step 2: Create/Edit the Exclusion File

nano /var/www/dealership.com/nginx/custom-skip-redis-cache-context.conf

Step 3: Add the Exclusion Rule

# Exclude inventory pages from cache (live API data)
if ($request_uri ~* "(/inventory.*)") {
set $skip_cache 1;
set $skip_reason "${skip_reason}-request_uri";
}

This excludes /inventory/, /inventory/trucks/, /inventory/sedans/, and any other child pages.

Step 4: Test and Reload

nginx -t
gp ngx reload

Step 5: Verify

Visit the inventory page and check response headers. You should see X-Cache: BYPASS instead of HIT.

After Adding Exclusions

  1. Test config: nginx -t
  2. Reload Nginx: gp ngx reload