Default Cache Behavior
Cloudflare respects the origin web server’s cache headers in the following order unless an Edge Cache TTL page rule overrides the headers.
- Cloudflare does not cache the resource if the
Cache-Controlheader is set toprivate,no-store,no-cache, ormax-age=0or if there is a cookie in the response. - Cloudflare caches the resource in the following scenarios:
- The
Cache-Controlheader is set topublicand themax-ageis greater than 0. - The
Expiresheader is set to a future date.
- The
- If both the
max-ageand anExpiresheader are set,max-ageis used.
For a list of directives and behaviors when Origin Cache-Control is enabled or disabled, see Cache-Control directives .
Default cached file extensions
Cloudflare only caches based on file extension and not by MIME type. The Cloudflare CDN does not cache HTML by default. Additionally, Cloudflare caches a website’s robots.txt.
| 7Z | CSV | GIF | MIDI | PNG | TIF | ZIP |
| AVI | DOC | GZ | MKV | PPT | TIFF | ZST |
| AVIF | DOCX | ICO | MP3 | PPTX | TTF | |
| APK | DMG | ISO | MP4 | PS | WEBM | |
| BIN | EJS | JAR | OGG | RAR | WEBP | |
| BMP | EOT | JPG | OTF | SVG | WOFF | |
| BZ2 | EPS | JPEG | SVGZ | WOFF2 | ||
| CLASS | EXE | JS | PICT | SWF | XLS | |
| CSS | FLAC | MID | PLS | TAR | XLSX |
To cache additional content, see Page Rules to create a rule to cache everything.
Customization options and limitations
Cloudflare’s CDN provides several cache customization options:
- Caching behavior for individual URLs via Cloudflare Page Rules
- Customize caching with Cloudflare Workers
- Adjust caching level, cache TTL, and more via the Cloudflare Caching app
Cloudflare limits the upload size (HTTP POST request size) per plan type:
- 100MB Free and Pro
- 200MB Business
- 500MB Enterprise by default. Contact Customer Support to request a limit increase.
If you require a larger upload, group requests smaller than the upload thresholds or upload the full resource through an unproxied (grey-clouded) DNS record .
Cloudflare cache responses
The output of the CF-Cache-Status header shows whether or not a resource is cached. To investigate cache responses returned by the CF-Cache-Status header, use services like
Redbot,
webpagetest.org, or a visual tool like
Chrome’s Dr. Flare plugin.
| Status | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| HIT | The resource was found in Cloudflare’s cache. | ||||||||
| MISS | The resource was not found in Cloudflare’s cache and was served from the origin web server. | ||||||||
| NONE | Cloudflare generated response. The resource is not eligible for caching. | ||||||||
| EXPIRED | The resource was found in Cloudflare’s cache but was expired and served from the origin web server. | ||||||||
| STALE | The resource was served from Cloudflare’s cache but was expired. Cloudflare could not contact the origin to retrieve an updated resource. | ||||||||
| BYPASS |
The origin server instructed Cloudflare to bypass cache via a Cache-Control header set to no-cache,private, or max-age=0 even though
Cloudflare originally preferred to cache the asset. BYPASS is returned when enabling Origin Cache-Control. Cloudflare also sets BYPASS when
your origin web server sends cookies in the response header.
|
||||||||
| REVALIDATED |
The resource is served from Cloudflare’s cache but is stale. The resource was revalidated by
either an If-Modified-Since header or an If-None-Match header.
|
||||||||
| UPDATING | The resource was served from Cloudflare’s cache and was expired, but the origin web server is updating the resource. UPDATING is typically only seen for very popular cached resources. | ||||||||
| DYNAMIC | Cloudflare does not consider the asset eligible to cache and your Cloudflare settings do not explicitly instruct Cloudflare to cache the asset. Instead, the asset was requested from the origin web server. Use Page Rules to implement custom caching options. |