4 ms·
Seems I've been downvoted for an unhelpful answer. :-P The problem isn't the size of each individual resource, it is the total volume of resources. In fact, t
by HerraBRE 15y ago
Seems I've been downvoted for an unhelpful answer. :-P
The problem isn't the size of each individual resource, it is the total volume of resources. In fact, the small size of web resources makes the problem worse, not better - a local disk beats the network when reading large volumes of sequential data (say, a movie). Small assets on the other hand, which you correctly assert are the majority, will result in lots of sequential disk seeks, whereas the network which can initiate many transfers in parallel can do much better.
Regarding the effect of the FS cache, I provide one unscientific data point: My Firefox cache had grown to 650MB in size - on a machine with 1GB of RAM. It is pretty obvious that the vast majority of those resources will not fit in the FS cache and will require some disk seeks to load and display. Reducing the size of the cache to something that more-or-less fits in RAM might make sense... but why bother with an on-disk cache at all then?
Constantly writing to the disk as I browse the web is also a major source of system load (cache churn, seeks, write traffic), and this effect is relative not to the size of the cache, but to the activity of my browser - turning the cache off eliminated this completely which may (or may not) offset any benefits provided by the occasional cache hit.
Finally, my testing implies that your worries about jquery and other shared elements within a website are needless, the browser also has a RAM cache and all the active things on a page live there. Clicking from page to page within a site does not trigger a reload of shared elements, even if the disk cache has been switched off.
I am still trying to come up with a way to accurately measure and benchmark the effects of local disk cache on the browsing experience. Once I have, I will run some tests and post the results.
Note that all of this is relevant to the OP, because the "call to action" of the OP was that browsers should increase the size of their disk caches. I suspect this would be, in many cases, a bad idea. I went and did the opposite, and so far my laptop - and the web - both feel snappier.