Daemon that manages the @vltpkg/cache disk store
npm install @vltpkg/cache-unzipThis is a script that can be run as a detached background process to
un-gzip any cached response bodies in the vlt cache.
Whenever you get a cache entry with a gzipped body, tell this module
about it.
``js
import { register } from '@vltpkg/cache-unzip'
import { Cache } from '@vltpkg/cache'
const cache = new Cache({ path: cachePath })
// later...
const response = get_response_cache_entry_somehow()
cache.set(myKey, response.encode())
// unzip it after this process is done
if (response.isGzip) {
register(cachePath, myKey)
}
`
On process exit, these registered keys will be passed as arguments to
a detached deref'ed vlt-cache-unzip process. So, the main programSIGHUP` and keeps
exits normally, but the child process ignores the
going until it's done. The next time that cache entry is read, it
won't have to be unzipped.
Because it's faster to not have to decompress the same content more
times than necessary.