WebPagetest Forums
Cloudflare and first byte - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: Cloudflare and first byte (/showthread.php?tid=921)



Cloudflare and first byte - DJMorrisInc - 07-13-2011 12:46 PM

I added Cloudflare to my Wordress blog and while it seems to be running fast and smooth, I now score a "C" for first byte and I have never seen this score below an "A"...I also have a very slow 2nd view time. Any suggestions, fixes, or experience with Cloudflare?

http://www.webpagetest.org/result/110713_1P_11P29/


RE: Cloudflare and first byte - ditaqhosting - 07-13-2011 06:37 PM

(07-13-2011 12:46 PM)DJMorrisInc Wrote:  I added Cloudflare to my Wordress blog and while it seems to be running fast and smooth, I now score a "C" for first byte and I have never seen this score below an "A"...I also have a very slow 2nd view time. Any suggestions, fixes, or experience with Cloudflare?

http://www.webpagetest.org/result/110713_1P_11P29/
Check your server specially your database server and web server. If i look on your result i see that the server take a long time to answer after the dns request. i guess it is the configuration of your database.


RE: Cloudflare and first byte - pmeenan - 07-13-2011 11:51 PM

By definition cloudflare will add some first byte time since it needs to go back to your server and process the data but it should be minimal. My algorithm for calculating a first byte time grade doesn't play nicely with something like cloudflare though so look at the before/after first byte times and compare those directly (doesn't explain the one long time you had in a repeat view though).

The algorithm for first byte time looks at the socket connect time to get an estimate of the round trip time to a server and then it uses a multiple of that as the baseline and adds 100ms for each letter.

Since cloudflare has distributed edge nodes, they actually make your socket connect time a LOT faster than if the browser had to go back to the original server directly so the baseline is lowered. The actual request still needs to travel back to your server though so it can't be any faster than it was before (and will usually be slightly slower). The effect that has is that it will lower the grade even if it is actually faster because the round trip time used for the baseline is faster.


RE: Cloudflare and first byte - craig2005 - 12-06-2016 12:38 AM

(07-13-2011 11:51 PM)pmeenan Wrote:  My algorithm for calculating a first byte time grade doesn't play nicely with something like cloudflare though so look at the before/after first byte times and compare those directly (doesn't explain the one long time you had in a repeat view though).

Just wondering if this has ever been updated. We are seeing the same really slow time to first byte with cloudflare. What should be the typical margin of error? 100ms? We are sometimes seeing a 500ms+ difference which seems high.


RE: Cloudflare and first byte - pmeenan - 12-06-2016 01:04 AM

My algorithm only comes into play for the grade (and yes, it has been updated). The timings are all (and have always been) accurate.

Make sure you are looking at the full TTFB (including DNS, socket connect and request) and not just the TTFB of the first request because with CDN't there is usually a trade-off where you get a faster connect to the edge but the connection to the origin is hidden in the request time.


RE: Cloudflare and first byte - pmeenan - 12-06-2016 01:05 AM

Oh, and there is no "margin of error" on the TTFB measurement. The measurement itself is accurate to sub-millisecond resolution.