Tagged: Page Cache
- AuthorPosts
luzio
GuestHi ,
I need to fully exclude a custom RSS endpoint from Page Cache (Disk: Enhanced), but the response still shows the W3TC footer and appears cached.
Goal
Serve a custom RSS feed (1 item per period) that must never be cached.Endpoints
Query-string version (legacy):
https://voyance-channel.com/?vc_horo_feed=1&sign=belier&freq=jourPretty URL (preferred):
https://voyance-channel.com/vc-horo-feed/belier/jour/Symptom
Even after exclusions, the XML still contains the footer:
“Performance optimized by W3 Total Cache — Disk: Enhanced (Requested URI contains query)”.Environment
W3TC Page Cache: Disk: Enhanced (latest stable)
CDN: Cloudflare (Cache Rule “Bypass” for vc_horo_feed and /vc-horo-feed/)
WordPress timezone configured; plugin sends proper Cache-Control: no-store, Pragma: no-cache, and defines DONOTCACHEPAGE.
What we’ve already configured in W3TC → Page Cache
Never cache the following pages (regex):
.*\?vc_horo_feed=.*
.*[&?]vc_horo_feed=.*
^/vc-horo-feed/.*Rejected query strings (one per line):
vc_horo_feed
sign
freq
_cb“Cache URIs with query string variables”: left disabled (when visible).
Purged all caches (W3TC) after each change.
Result
Query-string endpoint still served by Disk: Enhanced (footer present).
Pretty URL endpoint is more reliable, but we want a definitive W3TC-side exclusion.
Questions
“Never cache the following pages” field
Does this field accept full PCRE regex? Are the examples below valid for Disk: Enhanced?
.*\?vc_horo_feed=.*
.*[&?]vc_horo_feed=.*
^/vc-horo-feed/.*Do you recommend anchors/delimiters for matching query strings specifically under Disk: Enhanced?
Disk: Enhanced behavior with query strings
If a URL with query has already been written to the static cache, can DONOTCACHEPAGE and/or “Never cache…” be bypassed because Apache/Nginx serves the static file directly via .htaccess before PHP runs?
In that case, is “Purge All Caches” always sufficient, or should the specific cached file be removed manually?
Is there a recommended .htaccess directive from W3TC to force bypass of Disk: Enhanced based on a path/param pattern (e.g., vc_horo_feed), ensuring PHP is executed and the page is never served statically?
“Cache URIs with query string variables” option
In recent builds the checkbox may not be visible depending on UI mode. What is its default state, and is disabling it alone enough to prevent caching of query-string URLs under Disk: Enhanced?
Best-practice recommendation
For a custom RSS endpoint we control, is your best practice to use a pretty URL path (e.g., /vc-horo-feed/…) and exclude via
^/vc-horo-feed/.* in “Never cache the following pages”, plus a CDN bypass rule?Any additional W3TC setting you recommend specifically for feeds/endpoints that must always be fresh?
If you need any diagnostics (W3TC version, .htaccess snippet from Page Cache, or headers), I can provide them.
Thanks a lot!
Marko Vasiljevic
KeymasterHello Luzio,
Thank you for reaching out, and I am happy to help!
I’ve checked both URLs u shared:
The first one that contains a query string has an output:
Mise en cache de page à l’aide de Disk: Enhanced (Requested URI contains query)
By default, the W3 Total Cache, when using Disk: Enhanced, does not cache URIs with query strings. So the output means that the feed is not cached, because it contains a query string.As for the pretty URL, the output is:
Mise en cache de page à l’aide de Disk: Enhanced (Requested URI is rejected)
As you can see(Requested URI is rejected)means that the feed is not cached.In both cases, this is excluded from the cache
Please let me know if this answers your question and if there is anything else I can help you with
Thanks!- AuthorPosts