Check if Cloudflare Cache is working
Did you ever wonder if Cloudflare is actually serving cached content to your visitors?
Did you noticed some resources were not being served from cache in Cloudflare analytics dashboard?
Use this tool to verify the cache status of all resources on a page.
What are Cloudflare's Cache Headers (CF-Cache-Status)?
- 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.
- EXPIRED: The resource was found in cache but has since expired and was served from the origin web server.
- STALE: The resource was served from cache but is expired. Cloudflare couldn't contact the origin to retrieve the 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 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 cache but is expired. The resource is currently being updated by the origin web server. UPDATING is typically seen only 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.
Which files does Cloudflare cache by default?
Cloudflare only caches based on file extension and doesn't cache by MIME type. The Cloudflare CDN automatically caches files containing certain file extensions and doesn't cache HTML by default. You can use Cloudflare Page Rules to cache additional filetypes.
- Images: bmp, eps, gif, ico, jpeg, jpg, pict, png, ps, svg, svgz, tif, tiff, webp
- Scripts: class, ejs, jar, js
- Stylesheets: css
- Documents: csv, doc, docx, pdf, ppt, pptx, xls, xlsx
- Fonts: eot, otf, ttf, woff, woff2
- Multimedia: avif, mid, midi, pls, swf
How to purge and clear Cloudflare cache
- Go to Cloudflare and login
- Select your website
- In the top navigation menu select Caching → Configuration
- On the right-hand side you will see a button to Purge Everything
- Confirm and you're done.
Published: Wed, Apr 14 2021 @ 9:41:16
Back to Blog