Originally Posted By: deniro
Many years ago, many, I recall reading that if your browser seems slow, you should delete the cache.

The problem with browser caches is that the browser caches everything, until eventually it takes the browser longer to see if it has something in cache than it would to download it fresh.

This is a bug in the browser, one that I believe all modern browsers have addressed. On the one hand, every time they wanted to check if something was in the cache, they scanned the whole cache sequentially. Sequential searches slow down disproportionately the more things there are to search. (If you have ten times as many things in your cache, each search takes ten times as long. Each and every search. It adds up.) On the other hand, with internet connections getting faster and faster, less and less is gained from a successful cache hit.

But there are faster ways to search than sequentially. Browsers now typically cache data in a database rather than in individual files, and a database search (if the database is set up correctly) is just as fast no matter how many items are in the table. What was once good advice may no longer be.

There are some things that really benefit from being cached. For example, it's common for a website to have a single javascript file and a single CSS file shared by every page on the site. Caching the page itself buys you little, especially if the page's content is dynamic, but caching the JS and CSS files pays off handsomely, even over a fast connection.