Get started
Cloudflare makes customer websites faster by storing a copy of the website's content on the servers of our globally distributed data centers. Content can be either static or dynamic: static content is “cacheable” or eligible for caching, and dynamic content is “uncacheable” or ineligible for caching. The cached copies of content are stored physically closer to users, optimized to be fast, and do not require recomputing.
Cloudflare caches static content based on the following factors:
- Caching levels
- File extension
- Presence of query strings
- Origin cache-control headers
- Origin headers that indicate dynamic content
- Cache rules that bypass cache on cookie
Cloudflare only caches resources within the Cloudflare data center that serve the request. Cloudflare does not cache off-site or third-party resources, such as Facebook or Flickr, or content hosted on unproxied (grey-clouded) DNS records.
Discover the benefits of caching with Cloudflare's CDN and understand the default cache behavior.
- Understand what is a CDN ↗
- Understand default cache behavior
- Understand the default file types Cloudflare caches
Configure your settings to cache static HTML or cache anonymous page views of dynamic content.
- Customize Caching with Cache Rules
- Specify which resources to cache
- Understand Origin Cache Control
- Cache by device type (Enterprise only)
Include or exclude query strings, optimize cache keys, or enable tiered cache to improve hit rates and reduce traffic to your origin.
- Choose a cache level
- Enable Tiered Cache with Argo
- Configure custom cache keys (Enterprise only)
- Enable Prefetch URLs (Enterprise only)
Control resources a client is allowed to load and set access permissions to allow different origins to access your origin’s resources. Protect your site from web cache deception attacks while still caching static assets.
- Avoid web cache poisoning attacks
- Configure Cross-Origin Resource Sharing (CORS)
- Enable Cache Deception Armor
To provide Cloudflare services to our customers, we may need to alter your HTML or cached objects to enable the feature or provide optimization.
These code alterations only occur on the cacheable objects found at Cloudflare's edge and do not affect the original source. The changes will also be removed if the specific feature is disabled and the cache is purged.
Review the list of Cloudflare features that function in this manner:
- Rocket Loader
- Polish
- Mirage
- Hotlink Protection
- Email address obfuscation
- Bot Management JavaScript Detections
Resolve common caching concerns.
- Learn about Cloudflare's cache response statuses
- Investigate Cloudflare's cache response with cURL
- Diagnose Always Online issues