Delete multiple files in cache.
A predicate like array.filter(item => boolean)
Get metadata of a cached file
Get the size of a file in stored cache
NOTE: in case the download is stopped mid-way (i.e. user close browser tab), the file maybe corrupted, size maybe different from metadata.originalSize
The file name returned by getNameFromURL() or list()
number of bytes, or -1 if file does not exist
List all files currently in cache
The file name returned by getNameFromURL() or list()
Write the metadata of the file to disk.
This function is separated from write() for compatibility reason. In older version of wllama, there was no metadata for cached file, so when newer version of wllama loads a file created by older version, it will try to polyfill the metadata.
Cache implementation using OPFS (Origin private file system)
This class is also responsible for downloading files from the internet.