Current time: 03-08-2021, 05:33 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How looks server cache in WPT?
02-19-2021, 10:34 PM
Post: #1
How looks server cache in WPT?
Could somebody show or explain me, how looks in WPT a waterfall of page, which loads from server cache?
Find all posts by this user
Quote this message in a reply
02-20-2021, 02:21 AM
Post: #2
RE: How looks server cache in WPT?
There is no way to know from the browser unless the server adds a HTTP response header saying if it was served from cache or not (a lot of CDN's add a header). For that you can click on any request to see the response headers.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-22-2021, 01:35 PM
Post: #3
RE: How looks server cache in WPT?
If you've well optimized your site, you can run WebPageTest with the advanced option "First View and Repeat View" as well as running multiple test iterations (the default 3 runs will be fine).

The first iteration is likely an empty "server" cache unless your site already has a lot of public traffic geographically distributed. The 2nd view is likely a warmed up server and CDN. The 2nd test "repeat view" is likely a warmed up server/CDN AND warmed up browser cache. So those are your 3 cases, where each case should improve over the last in terms of performance.

I will include 3 waterfalls below to illustrate the progression of each cache layer:
  1. Empty browser cache (local) + Empty CDN Cache (server) - Fully Loaded 1.078s
  2. Empty browser cache (local) + WARM CDN Cache (server) - Fully Loaded 0.500s
  3. Full Browser Cache (local) - Fully Loaded 0.191s

Obviously this is a well optimized website to illustrate what "can be done" in theory (also doesn't have too much visual complexity or fancy features as of the date of this post).


[First View - Empty Browser Cache - Cold CDN Cache]

[Image: QVAzhakl.png]


[First View - Empty Browser Cache - WARM CDN Cache]


[Image: xfuHKhwl.png]


[Repeat View - All Cacheable Assets in Cache]

[Image: xBTeTBNl.png]


[VERIFY the warm CDN cache ("server" cache)]

[Image: U8UpIbLl.png]

Note #1: Different CDN's will have different headers, but as @pmeenan said I think all of them do surface the cache hit/miss in some fashion. Cloudflare can also show you your hit/miss statistics in their dashboard (sometimes CDNs slow your site down if you have very low or widely distributed traffic as every requests ends up being a cache miss and request to origin).

Note #2: The first waterfall above can be much longer when geographically further away. In my case it was going from Vancouver, BC, Canada to California which is some distance (latency) but it gets even worse if you test from east coast USA, and even worse yet if you test from Europe as the request to origin is increasing in latency when the CDN is cold. However, the 2nd and 3rd waterfalls should remain almost constant from anywhere in the world (once the local CloudFlare edge location is warmed up and/or the end user's browser cache is warmed up).

These screenshots are taken from the median result in this test run: https://webpagetest.org/result/210222_Di...3507fc0fb/

If my post helps you, click the little "user +" icon on the lower left to give me a rep!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)