Website speed
How to test your website speed
Enter your URL in PageSpeed Insights, then check its field data for an LCP of 2.5 seconds or less, an INP of 200 ms or less and a CLS of 0.1 or less.
· Mateo Cardenas
HomeGuidesWebsite speedWhat is Cloudflare CDN and how does it work?
Cloudflare's CDN, Cloudflare Cache, stores copies of frequently accessed content, such as images, videos or webpages, in geographically distributed data centers located closer to people than origin servers.1, source 1 Caching content closer to visitors reduces server load.1, source 1 It works because Cloudflare acts as a reverse proxy when DNS records have a proxied status, which means the record's HTTP/HTTPS traffic routes through Cloudflare on its way between the client and the origin server.2, source 2
Cloudflare Cache is available on all plans.1, source 1 The service caches content across Cloudflare's global server network.1, source 1 Purge lets you remove cached files so Cloudflare fetches fresh versions from your web server, and you can purge specific files or all at once.1, source 1
An HTTP cache stores a response associated with a request and reuses the stored response for subsequent requests.3, source 3 When a stored response is reused, the origin server does not need to parse and route the request, restore the session based on the cookie, query the database for results, or render the template engine.3, source 3 Managed caches are explicitly deployed by service developers to offload the origin server and to deliver content efficiently, and examples include reverse proxies and CDNs.3, source 3
A reverse proxy is a network of servers that sits in front of web servers and either forwards requests to those web servers or handles requests on behalf of the web servers.2, source 2 A reverse proxy server near a visitor can keep a cached copy of a response from a distant origin, so later visitors in that region get the locally cached version.2, source 2 It can also be configured to decrypt all incoming requests and encrypt all outgoing responses, which frees up resources on the origin server.2, source 2
When you onboard a website or application to Cloudflare, Cloudflare becomes the primary authoritative DNS provider for the domain, but only with the default, full DNS setup.2, source 2 When a domain is active and the queried DNS record is proxied, Cloudflare responds with an anycast IP address instead of the origin IP address defined in the DNS table.2, source 2 If the domain's status is active, all HTTP/HTTPS requests for proxied DNS records route through Cloudflare.2, source 2
A DNS record's proxy status controls whether HTTP/HTTPS traffic for that record routes through Cloudflare's network or goes directly to the origin server.4, source 4 In the dashboard, a proxied record is shown as an orange cloud icon.4, source 4 A proxied record lets Cloudflare apply product configurations such as WAF rules, caching and redirect rules to incoming traffic.4, source 4 Cloudflare anycast IP addresses are shared IP addresses used to route traffic through a nearby data center.4, source 4
All proxied records have a time to live (TTL) of Auto by default, which is set to 300 seconds and cannot be edited.4, source 4 Cloudflare recommends proxying all A, AAAA and CNAME records that serve web traffic.4, source 4 If multiple A or AAAA records share a name and at least one is proxied, Cloudflare treats all A or AAAA records on that name as proxied.4, source 4
In the dashboard, a DNS-only record is shown as a gray cloud icon.4, source 4 When a DNS-only record is queried, Cloudflare responds with the server's actual IP address and does not route HTTP/HTTPS traffic through its network.4, source 4 That answer exposes the origin IP address to anyone who queries the record, which removes a layer of protection against targeted attacks.4, source 4
Record types such as MX or TXT are always DNS-only.4, source 4 DNS-only is only recommended for records that do not serve web traffic, such as records used for email routing or third-party domain verification.4, source 4
Cloudflare only caches based on file extension and not by MIME type.5, source 5 The Cloudflare CDN does not cache HTML or JSON by default.5, source 5 By default Cloudflare caches a website's robots.txt.5, source 5 To cache additional content, you can create a Cache Rule to cache everything.5, source 5
Cloudflare caches a resource when the Cache-Control header is set to public and max-age is greater than 0, or when the Expires header is set to a future date.5, source 5 It caches a resource even when there is no Cache-Control header, based on status codes.5, source 5
Cloudflare does not cache a resource when the Cache-Control header is set to private or no-store, when the Set-Cookie header exists, or when the HTTP request method is anything other than GET.5, source 5
When several requests for the same uncached asset reach one Cloudflare data center at the same time, a cache lock means only the first request is forwarded to the origin.5, source 5 The cache lock ensures that Cloudflare only sends one request at a time to the origin for a given asset from a single location in Cloudflare's network, which prevents the origin from receiving excessive traffic.5, source 5 If Cloudflare has already started fetching content from the origin, it continues to retrieve and cache the entire content even when the visitor disconnects midway.5, source 5
Stored HTTP responses have two states, fresh and stale.3, source 3 In HTTP, age is the time elapsed since the response was generated.3, source 3 Stale responses are not immediately discarded, because HTTP can transform a stale response into a fresh one by asking the origin server, which is called validation or revalidation.3, source 3 Validation uses a conditional request that includes an If-Modified-Since or If-None-Match request header.3, source 3
The server responds with 304 Not Modified when the content has not changed since the time in the If-Modified-Since header.3, source 3 Even without a Cache-Control header, responses can be stored and reused when certain conditions are met, which is called heuristic caching.3, source 3 For resources that change, a common best practice is to change the URL each time the content changes so that the URL can be cached for a longer period.3, source 3
On Free, Pro and Business plans, Origin Cache Control is enabled by default and cannot be disabled.6, source 6 With Origin Cache Control enabled, Cache-Control directives in the origin server's response are followed as specified.6, source 6 With Origin Cache Control enabled, a max-age of 3,600 seconds makes Cloudflare cache the resource for that duration before checking the origin again for updates.6, source 6 By default, Cloudflare does not consider Vary values in caching decisions.6, source 6
Cloudflare respects whichever value is higher, the Browser Cache TTL in Cloudflare or the max-age header.6, source 6 The max-age directive indicates the response is stale after its age is greater than the specified number of seconds.6, source 6 When both Expires and Cache-Control: max-age are available, max-age is preferred.3, source 3 In shared caches, s-maxage overrides the max-age directive and the Expires header field.6, source 6
The public directive indicates any cache may store the response, even when it is normally non-cacheable or cacheable only within a private cache.6, source 6 The private directive indicates the response is intended for a single person and must not be stored by a shared cache like Cloudflare or a corporate proxy.6, source 6 The no-store directive indicates that no cache may store any part of the request or response.6, source 6
The no-cache directive does not prevent the storing of responses but instead prevents the reuse of responses without revalidation.3, source 3 When no-cache is set with Origin Cache Control off, Cloudflare does not cache; with it on, Cloudflare caches and always revalidates.6, source 6 The stale-while-revalidate directive indicates caches may serve a response after it becomes stale, up to the indicated number of seconds since it expired.6, source 6 The stale-if-error directive allows a cached stale response to be used when an error is encountered, regardless of other freshness information.6, source 6
Cache Rules customize cache settings on Cloudflare, adjusting what is eligible to cache, how long it is cached and where.7, source 7 You can create them in the dashboard, via API or with Terraform.7, source 7 They require that you proxy the DNS records of your domain or subdomain through Cloudflare.7, source 7
When a Cache Rule sets a custom cache key, the cache entry is indexed by that key rather than the request URL alone.7, source 7 Custom cache keys that include headers, cookies or other request properties prevent dashboard single-file purge from working, because the dashboard cannot send those values in a purge request.7, source 7 Single-file cache purging (purge by URL) is the recommended purge method.8, source 8 Cloudflare lets you purge cached content by cache-tags.8, source 8
To mark content as stale instead of removing it, you can invalidate cached content.8, source 8 Cloudflare revalidates invalidated content on the next request and reuses content that has not changed.8, source 8 A successful purge request returns HTTP 200, which indicates that Cloudflare received the request.8, source 8 To verify a purge, request the asset afterward and confirm that CF-Cache-Status is not HIT.8, source 8
Tiered Cache divides Cloudflare's data centers into a hierarchy of lower tiers and upper tiers.9, source 9 When content is not cached in a lower-tier data center, generally one closest to a visitor, the lower tier must ask an upper tier whether it has the content.9, source 9 When the upper tier does not have the content, only the upper tier can ask the origin for it.9, source 9 Limiting the number of data centers that can ask the origin for content improves bandwidth efficiency and reduces origin load.9, source 9
Tiered Cache concentrates connections to origin servers so they come from a small number of data centers, which results in fewer open connections using server resources.9, source 9 Tiered Cache applies only to requests that are eligible for cache at request time.9, source 9 Smart Tiered Cache dynamically selects the single closest upper tier for each origin with no configuration required.9, source 9 For an origin on a public cloud provider, you can set a cloud region hint that tells Smart Tiered Cache which cloud provider and region the origin is in.9, source 9
Regional Tiered Cache checks a regional hub data center near the lower tier before going to an upper tier that may be outside the region.9, source 9 Changing origin IPs or DNS records while Smart Tiered Cache is enabled may change the assigned upper tiers and raise the MISS rate while cache is refilled.9, source 9
The CF-Cache-Status header indicates whether a resource is cached or not.10, source 10 HIT means the resource was found in Cloudflare's cache.10, source 10 MISS means the response is eligible for cache but was not present in Cloudflare's cache at request time, so it was served from the origin web server.10, source 10 EXPIRED means the resource was found in Cloudflare's cache but was expired and served from the origin web server.10, source 10
STALE means the resource was served from Cloudflare's cache but was expired, and Cloudflare could not contact the origin to retrieve an updated resource.10, source 10 UPDATING means the resource was expired but served from Cloudflare's cache while the origin updates it in the background.10, source 10 DYNAMIC means Cloudflare determined at request time that the asset is not eligible for cache, so the request went to the origin without a cache lookup.10, source 10 A request can be DYNAMIC when the asset is not one of the default cached file extensions and no rule instructs Cloudflare to cache it.10, source 10
BYPASS means the asset looked eligible for cache but the origin response was not cacheable.10, source 10 Cloudflare returns the Age response header when it serves a response from cache.10, source 10
It is a caching service that stores copies of content near visitors. Cloudflare caching reduces server load.
No, it does not cache HTML or JSON by default. You can create a Cache Rule to cache these additional types of content.
No, HTTP/HTTPS traffic for DNS-only records does not route through Cloudflare. A DNS query to a DNS-only record exposes the origin IP address to anyone querying it.
You can purge cached files by URL, cache-tags or all at once. Single-file cache purging by URL is the recommended purge method.
Check the CF-Cache-Status header for a HIT value. This means the resource was found in the cache.
Every fact on this page comes from one of these, checked before it goes live.
Website speed
Enter your URL in PageSpeed Insights, then check its field data for an LCP of 2.5 seconds or less, an INP of 200 ms or less and a CLS of 0.1 or less.
· Mateo Cardenas
Email hosting
123 Reg's Web Hosting, Hosting for WordPress and Premium Hosting plans include email addresses, and 123 Reg sells Titan and Microsoft 365 email plans.
· Mateo Cardenas
Email hosting
Web hosting sometimes includes business email. See what SiteGround, Namecheap and HostGator state, then how MX records and SPF records work.
· Mateo Cardenas
Hosting types
How a free website builder works on WordPress.com, whose Free plan includes hosting but shows ads and limits the address, storage, plugins and support.
· Mateo Cardenas