Cache detection logic returns a lot of false positives
Created by: AxelDelmas
This method is supposed to detect when a segment comes back from cache. I see that the latency threshold has already been removed since I last checked, which is good since it was the main culprit IMO. But I also noticed a lot of false positives using the download time thresholds. Also, it does not account for the bitrate so it seems highly probable for me that fragment download from low bitrates will always be detected as coming from cache.
Isn't there a more reliable way to figure out if a request indeed comes from cache? I've found some stuff regarding looking up the Date
header but it seems some CORS response header configuration is needed to make that header accessible from JS.
It also seem that it's possible to use the Resource Timing API to figure out if a resource comes from cache, using transferSize
and encodedBodySize
which do not seem to have cross-domain restriction (but I'm not sure exeactly which browsers support these properties).