Doesn't solve rich data though as neatly as IndexedDB does.
Because IndexedDB uses structured clone, it can store javascript data as is, which includes storing correctly a number of interesting/useful types, including ArrayBuffers, Files/Blobs, CryptoKey instances (useful to avoid needing export flag on them), the cost of this is the performance hit compared to JSON.parse on a string.
Also the cache is less persistent than IndexedDB when storage pressure increases.
Comments
Doesn't solve rich data though as neatly as IndexedDB does.
Because IndexedDB uses structured clone, it can store javascript data as is, which includes storing correctly a number of interesting/useful types, including ArrayBuffers, Files/Blobs, CryptoKey instances (useful to avoid needing export flag on them), the cost of this is the performance hit compared to JSON.parse on a string.
Also the cache is less persistent than IndexedDB when storage pressure increases.