37

What is Chrome default cache size limit? Where it can be found?

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
demidov-alex
  • 373
  • 1
  • 3
  • 6

3 Answers3

8

According to Chromium source, it uses kDefaultCacheSize = 80 * 1024 * 1024 Bytes --> 80MiB and applies the first matching rule of the following to determine the actual (disk, HTTP) cache size

  • 80% of the available space if there is not enough space to use kDefaultCacheSize
  • kDefaultCacheSize if it uses 10% to 80% of the available space
  • 10% of the available space if the target size (2.5 * kDefaultCacheSize) is more than 10%
  • the target size (2.5 * kDefaultCacheSize) if it uses 10% to 1% of the available space
  • 1% of the available space

So that should be 10% of the available disk space at startup in the common case, with a moderately filled HDD.

Anonymous
  • 81
  • 1
  • 1
  • 3
    If I understand this correctly, the common cache size should be **1% of the available disk space**, not **10%**, considering most users should have more than 20,000MiB of available space. Or maybe a fixed cache size of 200MiB for users with less than 20,000MiB but more than 2,000MiB. That 10% only applies if user has less than 2,000MiB available (but more than 800MiB). I doubt most users fill storage to the brim like that, at least on desktops, though this might be more common in phones if the same calculation applies there. – Debie Downer Apr 26 '21 at 10:23
  • I think in practice there's an upper bound from https://chromium.googlesource.com/chromium/src/+/master/net/disk_cache/cache_util.cc#223 of 4 * kDefaultCacheSize (= 320 MiB). So in the case that the free disk space exceeds 400 * kDefaultCacheSize (= 32000 GiB ~ 32 GB), that hard limit applies. When I check cache usage empirically on devices that have way over that much free space (e.g., ~100 GiB free), I see cache usage in the 240-320 MiB range. – Vipul Naik May 28 '23 at 04:13
3

There isn't a default size for Cache in Google Chrome.
The maximum size of the cache is calculated as a percentage of available disk space. The default size is calculated at start time.

From: http://gent.ilcore.com/2011/02/chromes-10-caches.html

The maximum size of the cache is calculated as a percentage of available disk space. The contents can be viewed at chrome://net-internals/#httpCache. It can be cleared manually at chrome://settings/advanced or programmatically by calling chrome.benchmarking.clearCache() when Chrome is run with the --enable-benchmarking flag set. Note that for incognito windows this cache actually resides in memory.

Also, the article explains other 10 type of Caches like Memory Cache, DNS Cache etc.

0
  1. Create desktop shortcut
  2. Target: "C:\Program Files\Google\Chrome\Application\chrome.exe" --disk-cache-size = 1073741824 (In bytes, here 1GB are allowed)
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 02 '22 at 19:02