Firefox HTTP cache v1 API disabled

Given the positive data we have so far, we’re taking another step today to making the new cache official: we have disabled the old APIs for accessing the HTTP cache, so addons will now need to use the cache2 APIs. One important benefit of this is that the cache2 APIs are more efficient and never block on the main thread. The other benefit is that the old cache APIs were no longer pointing at actual data any more (it’s in cache2) :)

This means that the following interfaces are now no longer supported:

nsICache

nsICacheService

nsICacheSession

nsICacheEntryDescriptor

nsICacheListener

nsICacheVisitor

(Note: for now nsICacheService can still be obtained: however, calling any of its methods will throw NS_ERROR_NOT_IMPLEMENTED.)

Access to previously stored cache sessions is no longer possible, and the update also causes a one-time deletion of old cache data from users’ disks.

The new cache2 implementation gets rid of some of terrible features of the old cache (frequent total data loss, main thread jank during I/O), and significantly improves page load performance. We apologize for the developer inconvenience of needing to upgrade to a new API, but we hope the performance benefits outweight it in the long run.

Example of the cache v1 code (now obsolete) for opening a cache entry:

There is a lot of similarities, instead of a cache session we now have a cache storage having a similar meaning – to represent a distinctive space in the whole cache storage – it’s just less generic as it was before so that it cannot be misused now. There is now a mandatory argument when getting a storage – nsILoadContextInfo object that distinguishes whether the cache entry belongs to a Private Browsing context, to an Anonymous load or has an App ID.

Yes, the cache v1 API disable bug has been marked as ‘addon-compat’ and appropriate people are taking care. According directly targeting add-on authors, we have tools for checking the add-on sources. There are few extension using the old APIs, I will do my best to let the authors be contacted.

Edit: we have examined the sources and there seems to be no currently maintained extension that would only be using the old cache APIs with a need to migrate. There is not “Frank” to tell to.

Congratulations! The new cache is enabled in the current release, and I must say it makes the browser a joy to use on most devices. It was definitely worth the wait. My thanks go to you and Mr. Novotný, and everyone else at Mozilla for NOT giving up on this.