On this page

Source Code: lib/Cache.js#L63

Abstract cache interface backed by tapable hooks for reading, writing, idle transitions, and shutdown across webpack cache implementations.

new Cache(): Cache
Source Code: lib/Cache.js#L67
Returns:Cache

Initializes the cache lifecycle hooks implemented by cache backends.

Source Code: lib/Cache.js#L68
Type:Object
Type:SyncHook<[]>
Type:AsyncParallelHook<[]>
Type:AsyncSeriesBailHook<[string, Etag | null, GotHandler<any>[]], any>
Type:AsyncParallelHook<[]>
Type:AsyncParallelHook<[string, Etag | null, any]>
Type:AsyncParallelHook<[Iterable<string, any, any>]>
Type:number
Type:number
Type:number
Type:number
cache.beginIdle(): void
Source Code: lib/Cache.js#L157

Signals that webpack is entering an idle phase and cache backends may flush or compact pending work.

cache.endIdle(callback): void
Source Code: lib/Cache.js#L167
Attributes

Signals that webpack is leaving the idle phase and waits for cache backends to finish any asynchronous resume work.

cache.get(identifier, etag, callback): void
Source Code: lib/Cache.js#L93
Attributes
identifier:string
etag:Etag | null
callback:CallbackCacheCache<T>

Retrieves a cached value and lets registered gotHandlers observe the result before the caller receives it.

cache.shutdown(callback): void
Source Code: lib/Cache.js#L178
Attributes

Shuts down every registered cache backend and waits for cleanup to finish.

cache.store(identifier, etag, data, callback): void
Source Code: lib/Cache.js#L129
Attributes
identifier:string
etag:Etag | null
data:T

Stores a cache entry for the identifier and etag through the registered cache backend hooks.

cache.storeBuildDependencies(dependencies, callback): void
Source Code: lib/Cache.js#L145
Attributes
dependencies:Iterable<string>

Persists the set of build dependencies required to determine whether the cache can be restored in a future compilation.