Does CDN cache unique content per subdomain?

Can anyone confirm if the CDN for an account will cache unique content per subdomain?

For example, take the two examples:

Both www and dev subdomains proxy through the same cloudflare account with CDN enabled. They reference separate origin servers.

Does the CDN lookup only consider the path and query(/images/pic.png) or the full URL?

Basically, if we changed the image on the dev site, then a request to the dev site adds the resource to the CDN, would the www site return the new dev image or return the cached the www (e.g production) version?

The caching is done per URL, so each subdomain will have its own cache. You can set different caching levels based on query string only. (Dashboard > Cache > Caching Level or via page rules)

If you need to purge by subdomain, you can do this via API by listing all URLs to be purged in the body of the request.

Thank you so much! That’s the answer I was hoping for :slight_smile:

This topic was automatically closed after 30 days. New replies are no longer allowed.