mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-18 18:00:31 +00:00
Rather than letting our disk cache grow unbounded, let's impose a limit on the estimated total disk cache size. The limits chosen are vaguely inspired by Chromium. We impose a total disk cache limit of 5 GiB. Chromium imposes an overall limit of 1.25 GiB; I've chosen more here because we currently cache uncompressed data from cURL. The limit is further restricted by the amount of available disk space, which we just check once at startup (as does Chromium). We will choose a percentage of the free space available on systems with limited space. Our eviction errs on the side of simplicity. We will remove the least recently accessed entries until the total estimated cache size does not exceed our limit. This could potentially be improved in the future. For example, if the next entry to consider is 40 MiB, and we only need to free 1 MiB of space, we could try evicting slightly more recently used entries. This would prevent evicting more than we need to. |
||
|---|---|---|
| .. | ||
| CacheEntry.cpp | ||
| CacheEntry.h | ||
| CacheIndex.cpp | ||
| CacheIndex.h | ||
| CacheMode.h | ||
| CacheRequest.h | ||
| DiskCache.cpp | ||
| DiskCache.h | ||
| MemoryCache.cpp | ||
| MemoryCache.h | ||
| Utilities.cpp | ||
| Utilities.h | ||
| Version.h | ||