7

I'm looking at a waterfall in Chromes Developer tools of several CSS and Javascript files.

When refreshing the page, several of the files load from the browser cache, as expected. These are taking 1ms to load most of the time. However some files, and it seems to be the same offenders each refresh, are taking quite a bit longer. Sometthing between 400ms and 800ms.

The waterfall timeline in Chromes network tab shows that this time is spent in the TTFB (time to first byte) in some cases. This doesn't make any sense to me, if it's getting it from the browser cache it should be getting it from the hard drive, not the server, why is there a TTFB?

For other files or sometimes on a different refresh I see the time is blamed on content dowloaded time. Again, coming from cache this should be pretty instantaneous, yet I'm seeing it take over half a second sometimes.

Can anyone shed some light on what's happening here? This is a web app I'm working on so I don't have a link I can share I'm afraid.

Harry Robbins
  • 530
  • 4
  • 17
  • If a file takes 1ms to load, it is **not** coming from the hard drive. For a typical hard drive, it takes 1 ms just to wait for the disk to rotate half a revolution, never mind the seek time. – Craig S. Anderson May 22 '15 at 05:36
  • Where are you supposing it is coming from, memory? I've always understood the browser cache as being temporary files stored on the hard drive, in a folder you could visit in explorer, if you so desired. – Harry Robbins May 29 '15 at 22:20
  • It is likely coming from the page cache/file cache. Operating systems typically use any available memory to cache files so that file reads don't have to go to the hard drive or SSD. Hard drives also have caches. – Craig S. Anderson May 30 '15 at 06:32
  • Ok, but that still doesn't illuminate why I'm seeing a high TTFB time on some of the other resources. I'm still in the dark there. – Harry Robbins Jun 03 '15 at 16:26
  • 1
    I hate it when I find *exactly* the question I want to know and no answer :( did you ever find the reason? – David Gilbertson Aug 21 '16 at 22:25
  • 1
    Sorry man. Never did figure this one out. – Harry Robbins Aug 23 '16 at 17:42

0 Answers0