ladybird/Libraries/LibHTTP/Cache
Timothy Flynn d773ba25cf LibHTTP: Impose a limit on the total disk cache size
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.
2026-02-13 10:20:52 -05:00
..
CacheEntry.cpp LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
CacheEntry.h RequestServer: Do not flush the disk cache for unsuccessful requests 2026-01-23 14:24:20 +01:00
CacheIndex.cpp LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
CacheIndex.h LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
CacheMode.h LibHTTP+LibWeb+RequestServer: Handle the Fetch API's cache mode 2026-01-22 07:05:06 -05:00
CacheRequest.h LibHTTP+RequestServer: Implement the stale-while-revalidate directive 2025-12-13 13:07:02 -06:00
DiskCache.cpp LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
DiskCache.h LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
MemoryCache.cpp LibHTTP: Honor the no-cache Cache-Control request directive 2026-01-28 11:31:04 -05:00
MemoryCache.h LibHTTP+LibWeb: Support the HTTP Vary response header 2026-01-22 08:54:49 -05:00
Utilities.cpp LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
Utilities.h LibHTTP: Impose a limit on the total disk cache size 2026-02-13 10:20:52 -05:00
Version.h LibHTTP+LibWeb: Support the HTTP Vary response header 2026-01-22 08:54:49 -05:00