ServiceWorkerCacheStats#

Interface ServiceWorkerCacheStatsExperimental

Statistics about the data cached by the service worker, together with the origin-wide storage usage reported by the browser.

interface ServiceWorkerCacheStats {
    cacheCount: number;
    entryCount: number;
    quota: number;
    totalTransferSize: number;
    usage: number;
}
Index

Properties

cacheCount: number

Number of distinct caches currently tracked.

entryCount: number

Total number of individual cached entries across all caches.

quota: number

Origin-wide storage budget, in bytes, as reported by StorageManager.estimate(). This is a browser-imposed, padded estimate, not a hard CacheStorage limit.

totalTransferSize: number

Total number of bytes cached across all webvis caches, summed from the content-length of every cached entry. This is the transfer size (what crossed the network), not the on-disk footprint; for actual storage consumption see ServiceWorkerCacheStats.usage.

usage: number

Origin-wide storage currently in use, in bytes, as reported by StorageManager.estimate(). Includes all origin storage (Cache Storage, IndexedDB, ...), not just our caches. This (not ServiceWorkerCacheStats.totalTransferSize) reflects actual storage consumption.