To Improve Privacy And Speed, Cloudflare Launches 'Cloudflare Fonts' To Rival Google Fonts

Cloudflare Fonts

Cloudflare is a renowned content delivery and cybersecurity company, and that it has been in business for more than many years.

While the company never explicitly states a specific "speed goal," its primary aim is to make websites faster, more secure, and reliable. To do this, the company provides products that include content delivery network, or CDN, which optimizes the delivery of web content to end-users, and others.

As a way to continuously improve its users' website performance, Cloudflare introduces what it calls the 'Cloudflare Fonts'.

With just a click of a button, Google Fonts users should be able to "effortlessly load their fonts from the site’s own domain rather than from Google."

According to Cloudflare in a blog post, this "enhances both privacy and performance."

Google Fonts is a resource for web designers and developers, where the company puts together a huge library of free and open-source fonts.

These fonts can be easily integrated into websites to enhance typography and make web pages more visually appealing.

And in its explanation, using Cloudflare Fonts eliminates the need to load fonts from Google Fonts.

Websites using Cloudflare has its DNS directed to Cloudflare servers, which means that using Cloudflare Fonts will not create more requests for fonts that needed.

Without having to depend on Google Fonts, which is considered a third-party server, Cloudflare Font users should see a boost in their website's performance.

Cloudflare said that Cloudflare Fonts can speed up websites by "bringing fonts closer to end users," and also by "reducing the time spent on DNS lookups and TLS connections."

"Cloudflare Fonts streamlines this process, by reducing the number of round trips from eight to one. Two sets of DNS lookups, socket connections and TLS negotiations to third-parties are no longer required because there is no longer a third-party server involved in serving the CSS or the fonts. The only round trip involves serving the font files directly from the same domain where the HTML is hosted," explained Cloudflare.

Speed is achieved because Cloudflare Fonts removed CSS request, which eliminates one round trip.

"To achieve both the home-routing of font requests and the removal of the CSS request, we rewrite the HTML as it passes through Cloudflare’s global network. The CSS response is embedded, and font URL transformations are performed within the embedded CSS," said Cloudflare.

"With Cloudflare Fonts enabled, you are able to see within your Network Tab that font files are now loaded from your own hostname from the /cf-fonts path and served from Cloudflare’s closest cache to the user, as indicated by the cf-cache-status: HIT."

Cloudflare Fonts
When Cloudflare Fonts enabled, font files are loaded from the website's own hostname.

"This means there really is only one round-trip - fetching the font itself."

But to ensure that font delivery is instant, Cloudflare has to make Cloudflare Fonts use other technologies, including a module known as ROFL (Response Overseer for FL)

What it does, is dynamically altering HTML content.

"ROFL paved the way for the development of Cloudflare Fonts. The performance of ROFL allows us to rewrite HTML on-the-fly and modify the Google Fonts links quickly, safely and efficiently. This speed helps us reduce any additional latency added by processing the HTML file and improve the performance of your website," explained Cloudflare.

Cloudflare Fonts
When Cloudflare Fonts enabled, visitors' browser no longer has to initiate an extra DNS lookup for the hostname or the setup of a TLS connection.
Cloudflare Fonts
In comparison, using Google Fonts require visitors' website to initiate at least four round trips

And speaking of privacy, Cloudflare said that whenever a website loads a font from Google, the website must first initiate a data exchange with Google's servers.

What this means, the visitors' browsers must send requests directly to Google.

This should be a privacy concern for those who value their online privacy, because by sending data to Google, means that users are providing Google with a range of data, including IP addresses, user agents, referrer, requests, and more.

"While Google states that they do not use this data for targeted advertising or set cookies, any time you can prevent sharing your end user’s personal data unnecessarily is a win for privacy," said Cloudflare.

Because Cloudflare Fonts serve fonts directly from users' domain, website visitors no longer send data to third-party domains, like Google, which some privacy regulators have found to be a problem in the past.

And because no IP address or other data is sent to other domain, all those information is not shared to anyone, meaning that the website owner/webmaster can keep the information within their control.

Another thing, for users who live in countries with government-imposed restrictions, like China, Cloudflare Fonts can help websites reach those users because in general, Cloudflare isn't blocked in any country, nor it is considered a threat that needs localization requirements.

Published: 
12/10/2023