Opens in a new tab

Table of content

DJIA Cache – How To Exclude Pages & Content

Some pages must always be generated fresh. This guide shows how to exclude pages, single posts and even individual sections of a layout from the cache, using three methods that can be combined.

This guide explains how to exclude specific pages, URL patterns, or dynamic sections from being cached by DJIA Cache.

Exclude pages from the cache with the bypass rules in the Cache tab
Bypass paths, query keys and cookies are set in the Cache tab.

Quick Start

Use these methods when your website contains dynamic content that should never be cached.

Examples include:

  • shopping carts
  • user dashboards
  • profile pages
  • live counters
  • personalized content

Requirements:

  • Access to the WordPress admin panel
  • Or access to your page builder (Bricks, Elementor, etc.)

1. The Problem

By default, DJIA Cache treats pages as static content.

If a page contains user-specific or constantly changing data, caching it may result in:

  • outdated information
  • incorrect data shown to users
  • mixed session content

For example:

  • one user’s cart appearing for another user
  • outdated counters or dynamic values

To prevent this, specific pages or sections must be excluded from caching.


2. Methods to exclude pages and content

There are three main ways to exclude pages from DJIA Cache.


Method 1 — URL Bypass (Global)

Best for excluding entire pages or sections of the website based on their URL.

Steps

  1. Go to
    Settings → DJIA Cache → Cache
  2. Scroll to the Bypass paths field.
  3. Add the path you want to exclude.

Example:

/my-dynamic-page/
/user-dashboard/
/live-stats/
  1. Place one path per line.
  2. Click Save Changes.

Any page matching those paths will automatically bypass the cache.


Method 2 — djia-nocache CSS Class (Page Builders)

Best for excluding pages while using page builders such as:

  • Bricks Builder
  • Elementor
  • Gutenberg blocks

Steps

  1. Open the page in your page builder.
  2. Select a main container or section element.
  3. Add the CSS class:
djia-nocache
  1. Save the page.

When DJIA Cache detects this class in the page HTML, it will skip caching for the entire page.


Method 3 — HTML Comment (Classic Editor)

Best for manual control inside HTML editors or Classic Editor.

Steps

  1. Edit your post or page.
  2. Switch to Text / HTML view.
  3. Add this comment anywhere inside the page:
<!--DJIA_NOCACHE-->
  1. Save the page.

DJIA Cache will detect this comment and disable caching for that page.


3. Verification

To confirm that a page is excluded from cache:

Step 1

Open the page in a Private / Incognito browser window.

Step 2

Open Developer Tools:

F12 → Network Tab

Step 3

Refresh the page.

Step 4

Click the main document request and check the response headers.

You should see:

X-Djia-Cache: BYPASS

Instead of:

X-Djia-Cache: HIT

This confirms the page is not cached.


4. Important Notes

DJIA Cache automatically excludes common dynamic pages, including:

  • WooCommerce Cart
  • WooCommerce Checkout
  • WooCommerce My Account
  • WordPress login pages
  • REST API endpoints

You do not need to manually exclude these pages.


Further reading: WooCommerce.