ServiceWorkerConfig#

Interface ServiceWorkerConfigExperimental

Configuration of the service worker's local caching behavior.

interface ServiceWorkerConfig {
    cacheExpirationMs: number;
    cachingEnabled: boolean;
    evictionEnabled: boolean;
    logLevel: LogLevel;
    quotaLowerFraction: number;
    quotaUpperFraction: number;
}
Index

Properties

cacheExpirationMs: number

Maximum age of a cache before it is evicted, in milliseconds.

cachingEnabled: boolean

Whether the service worker is currently caching delivery-service responses locally. When false, requests bypass the cache entirely (no reads, no writes).

evictionEnabled: boolean

Whether quota-based auto-cleanup is enabled. When storage usage exceeds the upper limit, least-recently-read caches are evicted until usage drops below the lower limit.

logLevel: LogLevel

Verbosity of the service worker's logging.

quotaLowerFraction: number

Lower storage watermark as a fraction of the browser-reported quota (0..1). Eviction stops once usage drops below this. Must be smaller than the upper fraction.

quotaUpperFraction: number

Upper storage watermark as a fraction of the browser-reported quota (0..1). Eviction starts once usage exceeds this.