Following the release of IndexedDB support in private browsing mode (PBM), we have been working to support the Cache API and the implementation is almost finished.
We plan to let it ride for Firefox 122 release.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1714354
Specification: The Cache API standard in normal mode has been already supported for a long time. There is no formal specification for PBM in general.
Preference: dom.cache.privateBrowsing.enabled
Other browsers: Blink: shipped, Webkit: shipped
Cache API exposes an API to store persistent data in the form of request/response pairs. On disk, persistence is guaranteed by a sqlite database and there’s a separate on-disk sqlite database for every origin.
However, as privacy and security are becoming increasingly prevalent, users often prefer to use browsers in private browsing mode. Supporting storage APIs in PBM can be challenging, Firefox has long-standing support for LocalStorage, while support for IndexedDB was only introduced more recently. Cache API is the next in the line-up we are enabling support for. Some other browsers like Google Chrome already have full support for Cache API in their incognito mode. There’s still no formal standard or specification for PBM in general as it’s still an evolving feature (https://www.w3.org/2001/tag/doc/private-browsing-modes/). The CacheAPI implementation is built on top of work we laid down with IndexedDB and is now feature complete and we decided to let it ride the train for 122.
Please note that this also completes the groundwork to be able to enable Service Workers in PBM, but this requires more specific work to come soon. Thus there might be a (we think low) risk for some web-compat fallout here due to the maybe unexpected combination of enabled features in PBM.
Should there be any questions, besides posting it here please feel free to reach out to #workers-and-storage on matrix.
Thanks,
Harveer