Is it cleaner to just create a specialized protocol handler for cached newtab resources in this configuration?
```HTML
Add a moz-newtab-cached protocol handler that can run in the privileged about content process.
It’s job will be to get a remote stream from the parent for script, or for styles.
When the parent receives the request, the parent will get the hash value from prefs.
Will retrieve the cache entry for the particular resource - like, moz-newtab-cached://script.js - and check that the hash matches the expectation. If not, blow away all caches, fallback to streaming out the packaged script.
After retrieving the stream, kick off a DeferredTask that will eventually kick a check to see
if we need to refresh the cache. Once that fires, check RemoteSettings to see if the hash and/or version has changed.
If the hash and/or version has changed, download them and stream them into the cache:
Writing to the cache. When it’s time to write to the cache:
Recreate the entries for script and styles, and hold onto the new references.
Write the new hash into prefs.
Set the metadata to include the hash and version numbers.
Begin streaming, this puts the entries into WRITING mode.
Parallel stream scripts and styles into the cache output streams
If either fail, doom the cache entry. Clear the pref value for the hash. Try again later.
moz-newtab-cached protocol has one job: get a remote stream from the parent that will either pull from the valid cache entry OR will fallback to the built-in one. Which means that we have a bit of separation here:
moz-newtab-cached protocol handler is the “read-only” parts here. It just knows how to read from the cache. It does not know how to write to it. It knows how to fall back.
The other part is the business around noticing that a newtab loaded, and kicking off the DeferredTask to maybe write an update to the cache.
```