Can Cloudflare Automatic Platform Optimization (APO) Improve TTFB and FCP

Case Study of TTFB and FCP values from different server locations around the world. Effect of Cloudflare APO. Core Web Vitals.

Static content pages load much faster than websites containing dynamic pages and visual elements. WordPress is a CMS used by the majority of blog owners. This constitutes PHP code and database queries.

When a WordPress post is served to the visitor, it has to fetch resources from the server. The final front-end version of HTML content is displayed to the visitor. This takes a lot of time in rendering the pages. But WordPress has the benefit of ranking well in search engines.

Many things can slow down your site. The number of images, plugins, JavaScript, CSS, graphic elements, videos etc. Page Caching at the server level reduces this amount of load and serves your pages quickly.

Also Read – Does Cloudflare Automatic Platform Optimization Improve Site Speed ?

Caching is a mechanism where most of your resources are stored as static content. When the first visitor requests your page, most of them are stored as cache. This is done using page cache plugins or server cache.

But still the HTML part has to be more close to the visitor location. Otherwise, fetching the content from the origin server will increase the load speed of the site. This is where edge servers and caching play a major role.

Also Read – Using Cloudflare to Improve WebSite Speed  to less than 90 secs

Cloudflare APO – Why you need it

Automatic Platform Optimization (APO) is a new feature from Cloudflare. This was recently announced in 2020. It has the benefit of loading your page more quickly. There are about 200 data centers where the edge servers are residing. Your HTML content is cached in these server locations and distributed to your clients on request.

When the first request is made, all the server locations are updated with your post HTML content. This will make your WordPress site almost like a static site. Instead of doing the PHP code execution and database operations, the first page request is rendered quickly.

Also Read – Railgun and Auto-Minify in Cloudflare – Their Role in Web Page Load Speed (Case-Study)

What is TTFB

The full form is Time to First Byte. This is the amount of time taken when a visitor makes a web page request to the first byte of data received from the server. This is very significant in page load speed of the site. The quicker is the TTFB, the faster the requested resource will be delivered to the visitor.

This generally consists of 3 components.

  1. The amount of time required to send the HTTP request from the client.
  2. The time required by the server to process the code, resources, CSS, JS and convert to HTML.
  3. The time needed to send back the first byte of the requested resources in HTML form.

The initial server request takes some time to respond. This can also be visualized using the GTMetrix test. The following is the screenshot for one of the web pages.

As you can see the total TTFB time is 116.8ms tested from the San Andreas, Texas location in the USA. The TTFB time consists of the following as measured by the speed testing tool.

  1. Blocking – 1.4ms
  2. DNS Lookup – 31.4ms
  3. Connection request – 38.8ms
  4. SSL request – 22.8ms
  5. Send the HTML request – 0.3ms
  6. Process and Waiting time of HTML – 28.9ms
  7. Receiving the first byte – 19.4ms

In most cases, when the Cloudflare APO is not enabled, the waiting and receiving time will be higher. This in-turn will increase the amount of TTFB and server response time.

Cloudflare APO – Benchmark Tests

In a recent blog post, it was mentioned that the edge server residing close to the origin server will not give much benefit from Automatic Platform Optimization feature. In order to test the benefit of APO page load speed has to be tested from different server locations.

But no practical metrics or proof were mentioned of the same in the article. Cloudflare blog post says that using APO will improve TTFB and FCP values. These are part of the new web vital statistics.

Without Cloudflare APO – GTMetrix Test Results

The first site was tested without using Cloudflare APO. All the other parameters were kept the same. The number of plugins, CSS, JS, images and are the same. In order to compare the efficiency of TTFB, FCP and other performance metrics, the same page with and without Cloudflare APO was tested using GTMetrix test.

7 different server locations were used for this test also. The following are the results.

TTFB and FCP Values – Different Server Locations

S.NoTest Server LocationTTFBFCPPage Size
1San Antonio, TX, USA207.8ms0.9s24.3KB
2Hong Kong, China1.38s1.8s24.6KB
3London, UK284ms0.8s24.6KB
4Mumbai, India443.6ms0.8s24.6KB
5Sydney, Australia282ms0.8s24.6KB
6Sao Paulo, Brazil342.9ms1.7s24.7KB
7Vancouver, Canada109.3ms0.5s24.4KB

Core Web Vitals

S.NoTest Server LocationGTMetrix GradeLCPTBTCLS
1San Antonio, TX, USAE1.3s1.0s0.1
2Hong Kong, ChinaF2.2s1.5s0.09
3London, UKE1.1s1.1s0.1
4Mumbai, IndiaB1.0s412ms0.06
5Sydney, AustraliaF1.4s2.8s0.1
6Sao Paulo, BrazilF2.2s0.6s0.09
7Vancouver, CanadaD0.7s0.7s0.1

Case Study – With Cloudflare APO

In order to test the above hypothesis, 2 sites were tested from 7 different server locations.

The first site was using Varnish cache and FVM cache plugin. It was on the free cloudflare CDN version. In addition the APO feature was enabled.

The second site did not have the advantage of server cache and premium optimization plugin. It had only free Cloudflare plan and PageSpeed Ninja plugin installed.

The original server was residing in the USA. So it is expected that US traffic will not have much benefit from the APO feature. Only distant server locations like UK, India, China are expected to see better values.

GTMetrix testing tool was used to measure the TTFB and core web vitals. This is a more thorough test giving different performance metrics and has the feasibility of testing the article from server locations around the world.

It was emulating the desktop page on Chrome browser version 86.0.4240.193 and Lighthouse version 6.3.0.

Since there were Google Adsense ads and Video ads displaying on the site, the grade was not that great.

Test Results

The following were the core web vitals, time to first byte and gtmetrix grade scores.

Site #1 – windowstechit.com

The following is the URL tested.

https://www.windowstechit.com/18804/transfer-files-from-google-drive-to-onedrive/

 Test Server LocationFCP TTFBInitial Page size
1San Antonio, TX, USA1.1s109.4ms26KB
2Hong Kong, China0.6s132.9ms25.8KB
3London, UK1.1s65.3ms26KB
4Mumbai, India0.7s256.9ms26KB
5Sydney, Australia373ms83.8ms25.9KB
6Sao Paulo, Brazil348ms142.6ms26KB
7Vancouver, Canada0.6s365.4ms25.8KB
 Test Server LocationGTMetrix GradeLCPTBTCLS
1San Antonio, TX, USAC1.2s264ms0.1
2Hong Kong, ChinaE1.0s1.9s0.1
3London, UKB1.3s100ms0.09
4Mumbai, IndiaE1.1s1.0s0.1
5Sydney, AustraliaE0.8s0.7s0.1
6Sao Paulo, BrazilD0.6s468ms0.1
7Vancouver, CanadaD0.7s380ms0.1

Site #2 – wpreviewtips.com

The second site url.

[Review] #1 Best AMP Plugin in 2020 – Ideal Settings

S.NoTest Server LocationFCPTTFBPage Size
1San Antonio, TX, USA1.0s681.2ms23.7KB
2Hong Kong, China1.1s231.4ms23.5KB
3London, UK294ms86.3ms23.6KB
4Mumbai, India1.2s276.7ms22.8KB
5Sydney, Australia0.6s118ms23.5KB
6Sao Paulo, Brazil383ms165.9ms23.5KB
7Vancouver, Canada0.5s144.8ms23.5KB
S.NoTest Server LocationGTMetrix GradeLCPTBTCLS
1San Antonio, TX, USAA1.0s68ms0.33
2Hong Kong, ChinaA1.1s0ms0.02
3London, UKA294ms54ms0.19
4Mumbai, IndiaA1.2s95ms0.01
5Sydney, AustraliaA0.6s112ms0.19
6Sao Paulo, BrazilA383ms32ms0.43
7Vancouver, CanadaA0.5ms30ms0.41

Improvement in TTFB and FCP

After using Cloudflare APO there was reduction of time to first byte values by 75 to 330%.  Without using the Cloudflare APO the values were between 200 to 450ms. Though this is of medium nature as compared to Google recommended values, they still could be reduced.

On enabling the Cloudflare APO, values decreased between 85 to 230ms. Except for 1 erroneous value, all the other server locations were displaying improvement in TTFB values.

The FCP values were also showing great performance. The values decreased from 800ms to 350ms in some cases. From 3 server locations the FCP metrics were higher using Cloudflare APO compared to not using it. The reduction in FCP was between 25% to 500%. The increase was between 20% to 30%.

In some cases, the values decreased to 373ms. Without using this service from Cloudflare the values were between 800ms to 1700ms. On using the APO feature, they reduced to 360 to 600ms in some cases. A clear pattern could not be seen. So the conclusive evidence that FCP values will reduce cannot be deduced.

Analysis

  1. All the GTMetrix grade scores were either D or E for site 1. The second site had a perfect grade of A. The video ads and display ads were spoiling a perfect score for first site.
  2. Time to First Byte (TTFB) times were between 65ms to 365ms. There was a lot of variation in these values when tested from different server regions.
  3. Though both sites were having the same initial page size, the first site was displaying lower TTFB values compared to the second site. This can be attributed to the Varnish and FVM cache plugins installed on the first site.
  4. TTFB values were less when using the APO service. The least value was from the London server. The maximum value was from a Canada server. This was for the first site.
  5. Though Canada was next to the USA, it is surprising that a higher value was recorded.
  6. Sydney and London were having the least TTFB values for both the sites.
  7. The size of the initial page was almost equal from all the server locations.
  8. FCP values were also lower, but were showing variation like TTFB values.
  9. FCP metrics were lower from London and Brazil locations for the second site.
  10. The least FCP were from Brazil and Sydney for the first site.
  11. CLS values were almost constant from any server location.

Conclusion

As seen above, TTFB values decreased when using the Cloudflare APO. But change of test server location had significant influence on those values. Some of the Core Web Vitals were also difficult to understand based on the server location.

Even though there are 200 data edge centers around the world, the same performance metrics were not recorded. This is an interesting observation from a server location point of view. Also, the theory that an edge server close to the origin will have better TTFB is also not correct.

In order to better understand TTFB and FCP values, tests need to be conducted without APO from the same server locations. This will give a better idea of the benefit of using Cloudflare APO.

Rate this post

Leave a Comment

 

Exit mobile version