Becca
Becca

Reputation: 1580

Does clearing the browser cache really improve performance?

There's already a question about this (What is it about web browser cache design that causes performance to degrade when the cache grows), but there's no answer in that question. So here's my three part question.

  1. Does clearing the browser cache really improve performance?
  2. If so, why? Is there any hard data?
  3. What is the magnitude of the slow down?

The most detailed explanation I can find is http://www.stevesouders.com/blog/2010/04/26/call-to-improve-browser-caching/, which just says

The data shows that 55% of people surveyed have a cache that’s over 90% full.

One of the first hits on Google is http://www.nyu.edu/its/faq/cache.html:

Over time, this process may actually begin to slow down your browser as large amounts of data are saved to your hard drive.

That doesn't seem like enough of an explanation. It seems to me that a new browser should be able to manage the cache better, but I also know that things that seem intuitive often aren't so simple. Does the cache eventually reach a state similar to thrashing where it's constantly removing things from the cache to put things into the cache?

Thanks!

Upvotes: 2

Views: 1441

Answers (1)

Stephen Bailey
Stephen Bailey

Reputation: 21

It is my understanding that when the browser cache becomes "full" - in that the browsers allotted amount of free space it can utilise for the cache becomes full, then it will indeed have to remove items to replace them with newer resources.

When you first start using a browser, your cache is empty and ergo, you get the maximum speed out of your cache. As it reaches the maximum allowed size, you start to see the browser doing much more additional work than it was doing before as it will now have to:

1) Find the size of the new resource(s)

2) Check the amount of free space available

3) If there isn't enough:

3A) it needs to determine which resources to remove to make room (different browsers will typically do this in their own way - for example, it may delete resources from sites you've visited infrequently, others may take the approach of deleting the oldest files etc).

3B) Delete those files from the cache

4) Save the new resource(s) to the cache

This may be compounded by the fact that websites are designed in such a way that they may typically pull in resources after it has finished loading, kicking off the cache clearing process again and again as new resources such as AJAX requests, images and the like get "lazy loaded" onto the page.

There is also the fact that websites are typically constructed from numerous smaller objects such as images, javascript & CSS files - and there is some inherit latency in fetching larger and larger numbers of files from hard disks (especially mechanical, none-SSD) which may also compound the cache process.

Upvotes: 2

Related Questions