On 24 May 2017 at 19:01, Nicolas B. Pierron <nicolas.b.pier...@mozilla.com> wrote:
> On 05/24/2017 03:36 PM, Valentin Gosu wrote: > >> As part of the Quantum Network initiative we are working on a project >> called "Race Cache With Network" (rcwn) [1]. >> >> This project changes the way the network cache works. When we detect that >> disk IO may be slow, we send a network request in parallel, and we use the >> first response that comes back. For users with slow spinning disks and a >> low latency network, the result would be faster loads. >> > > Should we introduce a bias, in order to favor data coming from the > alternate data, knowing that the alternate data stream might be bigger but > reduce the upcoming work following the plain data? The concern here is > that the alternate data might be slower to load, but faster to process. > We already have logic in place to never race when we have alt-data in the cache. > > Do we have a way, from the nsICacheInfoChannel, to distinguish when data > came from the network, as opposed to from the cache? The concern is that > we want to avoid adding additional cost while try aggregate alternate data. > Alternate cost which might slow down the execution speed after the network > access. > We can use nsICacheInfoChannel.isFromCache() for that. Bug 1358038 also adds nsICacheInfoChannel.isRacing() in order to show that info in the devtools panel (otherwise developers might be confused as to why their pages weren't properly cached) > Overall this sounds like an awesome idea, if the stream is known to have > no alternate data, or to compensate the alternate data savings. Maybe we > could provide some estimates for the alternate data savings, based on the > mime type? > So, at the moment, we never race for channels that have the LOAD_ONLY_FROM_CACHE | LOAD_NO_NETWORK_IO flags set, if the channel is used by service workers, if the cache entry has alt-data saved, or if the size of the cache entry is above 256 Kb. The trigger to race is if the size of the Cache IO queue is above a certain threshold - which usually indicates slow disk IO, but varies greatly between hardware configurations. We expect by the time we release this feature to be able to watch the cache speed constantly so we'll know exactly when the cache is slow and trigger racing. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform