Does Cloudflare cache external resources?

Sorry for my stupid question.

If I host example.com on Cloudflare, will Cloudflare cache the requested resource under the same domain as the request hit by the same site, such as example.com/api_v2/get_something?

If so, what happens if the request is for a subdomain such as api.example.com/get_something or another external domain?

Those don’t look like an external domain. They all look like they’re part of example.com, and that would all fall under your account’s caching for that domain. Subfolders and subdomains are all treated as part of the main domain they’re under.

If my site requests json resources from an external domain name (e.g. weather.com), will Cloudflare also cache these resources? Thanks.

No, Cloudflare will not cache third-party resources used by your site unless that third party happens to also be using Cloudflare and they’ve already set up caching. But you won’t be able to control third-party caching.

So the caching mechanism will only happen to resources under the same domain name?

That is correct. Only under your same domain name.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.