Skip to main content
NageshRaja
Level 5
Oct 6, 2026 10:05 AM UTC
Question

Validate CDN Caching Disabled

Hi All,

 

I am trying to disable CDN caching in AEM Cloud - 

As per https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/how-to/disable-caching we can do the below - 

<LocationMatch "$URL$ || $URL_REGEX$">
# Removes the response header of this name, if it exists. If there are multiple headers of the same name, all will be removed.
Header unset Cache-Control
Header unset Surrogate-Control
Header unset Expires

# Instructs the Browser and the CDN to not cache the response.
Header always set Cache-Control "private"

# Instructs only the CDN to not cache the response.
Header always set Surrogate-Control "private"
</LocationMatch>

However, there is no mention on how to validate the same?

I did add the above property in my vhost file but the CDN logs still show the cache as HIT versus MISS or PASS.

<LocationMatch "^/etc\.clientlibs/.*\.(js|css)$">
Header unset Cache-Control
Header unset Surrogate-Control
Header unset Expires

Header always set Surrogate-Control "private"
</LocationMatch>

The logs below still show the cache as HIT - What am I missing?

{"timestamp":"2026-10-06T05:53:53+0000","ttfb":248,"ttlb":249,"cli_ip":"23.44.4.166","cli_country":"SG","cli_region":"SG-01","rid":"a3d000e5-e7c7-49a0-86dd-f97e92802165","req_ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36","aem_envKind":"SKYLINE","aem_tenant":"abcglobalcom","host":"abc.com","url":"/etc.clientlibs/abc-platform/clientlibs/clientlib-base.min.css","method":"GET","res_ctype":"text/css;charset=utf-8","cache":"HIT",debug":"","res_age":"1010401","status":200,"pop":"SIN","rules":"","alerts":"","sample":"","ddos":false}

Thanks in advance,

NK

4 replies

AmitVishwakarma
Community Advisor
Community Advisor
Oct 6, 2026 11:13 AM UTC

Hi ​@NageshRaja 
cache=HIT by itself does not confirm that the new vhost rule failed. It means the CDN served an existing cached object without fetching the response from AEM, so the new response headers were not evaluated for that request.

For CSS client libraries, Adobe's guide notes that bypassing an existing cached CSS object requires changing the CSS file to generate a new cache key. Please test with a changed/versioned CSS URL after confirming the vhost change was successfully deployed to the correct environment. Then check the response headers and the CDN log for that URL. In the CDN logs, HIT means served from cache; PASS means the response was explicitly marked not to be cached and is retrieved from AEM.

If a new URL/cache key still shows HIT, verify that the LocationMatch pattern matches the requested URL and that the rule is present in the active vhost. Also note that vhost cache headers control CDN behavior; they do not disable Dispatcher caching.
https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/how-to/disable-caching
https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/cdn-cache-hit-ratio-analysis
https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/publish

Translate
Amit Vishwakarma - Adobe Commerce Champion 2025 | 17x Adobe certified | 6x Adobe SME
NageshRaja
Level 5
Oct 6, 2026 12:18 PM UTC

I did purge the cache and hit again but got CACHE=HIT
If you see the cURL output below - 
Surrogate-Control never shows up here

 

Translate
AmitVishwakarma
Community Advisor
Community Advisor
Oct 6, 2026 2:26 PM UTC

Hi ​@NageshRaja 
Thanks for checking. A HIT means the CDN served a cached object without fetching a new response from AEM. So it does not, by itself, show whether the updated vhost rule is active: the request may still be using an existing cache entry, or the rule may not be affecting the response.

For a clean test, Adobe's guide specifically recommends changing the CSS file to generate a new cache key when bypassing an existing cached CSS client library. Deploy the vhost change to the target Publish environment, then request that new CSS URL and check the corresponding CDN log entry. A PASS means the response was marked not to be cached and is fetched from AEM; a MISS means the URL was not in cache and was fetched from AEM; a HIT means it was served from cache.

 

Your snippet sets Surrogate-Control: private. Check the actual response headers for the new URL to confirm that header is present and that no other cache header is overriding the intended behavior. Adobe's CSS-specific example uses Cache-Control: private; try that documented example for a controlled test if needed. Also verify that the rule is enabled in the deployed vhost, matches the exact requested path, and is deployed to the environment serving abc.com.

If the new URL still logs HIT, confirm that you are checking the exact hostname, path, and request made after the purge; then review the deployed vhost and response headers. A HIT cannot validate headers from a fresh AEM response because that request did not fetch one from AEM.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/how-to/disable-caching

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/caching/cdn-cache-hit-ratio-analysis

Translate
Amit Vishwakarma - Adobe Commerce Champion 2025 | 17x Adobe certified | 6x Adobe SME
Mani_kumar_
Community Advisor
Community Advisor
Nov 13, 2026 5:36 AM UTC

There are two separate problems here, and the log line proves the first one. `res_age` is 1010401 seconds — about 11.7 days. That object was cached around Sep 24, before your rule was ever deployed. A HIT on it tells you nothing about whether the rule works: the CDN served the stored object without ever fetching from AEM, so your new headers were never evaluated.

 

The second problem is that the rule is not actually active for this URL. Your deployed config sets only `Surrogate-Control "private"` — the `Cache-Control "private"` line from Adobe's example is missing — and your own cURL output contains neither header at all. If the rule were live in the active vhost, the response would carry at least `Surrogate-Control: private`. It doesn't, so the rule is not applying to this request: wrong vhost, wrong environment, or the pattern not matching.

 

Fix the config first — restore both lines from Adobe's "How to disable CDN caching" example:

 

```

<LocationMatch "^/etc\.clientlibs/.*\.(js|css)$">

  Header unset Cache-Control

  Header unset Surrogate-Control

  Header unset Expires

  Header always set Cache-Control "private"

  Header always set Surrogate-Control "private"

</LocationMatch>

```

 

Deploy it to the publish environment and confirm the deployment actually landed (Cloud Manager pipeline run for the dispatcher config).

 

Then validate on a fresh cache key — do not re-test the old URL. Per Adobe's guide, change the CSS file so the client library gets a new cache key, or request the URL with a new query string such as `?v=2` (a non-marketing parameter creates a new CDN cache key). Then:

 

```

curl -s -D - -o /dev/null "https://abc.com/etc.clientlibs/abc-platform/clientlibs/clientlib-base.min.css?v=2"

```

 

Expect `Cache-Control: private` and `Surrogate-Control: private` in the response, and the CDN log for that URL to show `PASS` — explicitly not cached, fetched from AEM — not HIT. If the headers are still absent, the rule is still not in the active vhost: check the LocationMatch regex against the exact URL, that the rule sits in the publish vhost (your cURL shows `x-vhost: publish`), and that you deployed to the same environment you're testing.

 

Two things this does not do: vhost cache headers control the CDN only — they do not disable Dispatcher caching, which is a separate `/cache` configuration. And purging the old URL alone won't prove the rule works; the new-key test above is the proof.

 

Verify in the CDN log for the new URL: `cache` should read `PASS` and `res_age` should be small. If the new URL still logs HIT, you are looking at the wrong hostname, path, or environment — or another cache layer in front of Adobe's CDN.

Translate