Open Bug 1129121 Opened 9 years ago Updated 2 years ago

<audio> and Mozilla Firefox Cache issue

Categories

(Core :: Audio/Video: Playback, defect, P3)

35 Branch
x86_64
Windows 8.1
defect

Tracking

()

Tracking Status
firefox35 --- affected
firefox36 --- affected
firefox37 --- affected
firefox38 --- affected
firefox-esr31 --- affected
firefox-esr38 --- affected

People

(Reporter: emironen0, Unassigned)

References

Details

(Keywords: compat, regression)

Attachments

(1 file)

Attached file experimental.war
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150122214805

Steps to reproduce:

I have the next html code

<script type="text/javascript">
    playSound = function(soundUrl) {
        var sound = new Audio(soundUrl);
        sound.type = 'audio/wav';
        sound.autobuffer = false;

        sound.play();
    }
</script>

<input type="button" onclick="playSound('audioCaptcha')" value="Play"/>

audioCaptcha is path to my audio storage, which returns the unique audio fragment. It works perfectly with Google Chrome and IE, but does not with Mozilla Firefox. Because of strange working of cache I'm getting the old audio fragment every time. Header: "Cache-Control", "private,no-cache,no-store"

Network statistic shows only one GET request for audioCaptcha. At the next attempts no one request appear and Firefox will use the previous audio fragment. But if the user will wait ~20 second then everything is fine. Looks like that in spite of Cache-Control headers Firefox store it. 

How to reproduce:
1. Go to http://95.85.32.78:8080/experimental/ or deploy application on one's own (see attachments)
2. Click to "Play" button. 
3. Press F5. Click to "Play" button again.


Actual results:

At the first attempt browser sends GET request "audioCaptcha" to server and gets fresh audio fragment. At the next attempts browser does not sends GET request, but takes audio fragment from cache. Thus, captcha audio fragment is invalid. 
If user will wait ~20 second then everything is fine.


Expected results:

Because of header "Cache-Control", "private,no-cache,no-store" browser should not store audio fragment in cache and it should sends GET request everytime.
trying networking:cache first, i don't know if video/audio implements it's own caching
Component: Untriaged → Networking: Cache
Product: Firefox → Core
Just compare the behavior of Mozilla Firefox with Google Chrome. I think that Firefox should not store the cache with header "Cache-Control", "private,no-cache,no-store"
Component: Networking: Cache → Audio/Video
Component: Audio/Video → Audio/Video: Playback
Clearly we're doing something wrong here. I wonder if it would be easy to fix. Do we have a thing where we can simply bypass the cache ?
Flags: needinfo?(jyavenard)
Everything goes through the media cache... including for new playback... So not going through the cache, or have the media cache behaves differently once it's been played once is going to be a difficult issue to resolve.
the code is hard to maintain too.
Flags: needinfo?(jyavenard)
Rank: 29
Priority: -- → P3

Bug 703379 comment 0 claims that sharing media resources was permitted.
I'm not seeing that in https://fetch.spec.whatwg.org/ now.
HTTP-network-or-cache fetch should be performed after ServiceWorker handling, and presumably the "Cache-Control" header should affect the use of that cache.

Bug 802310 comment 4 similarly claims that "We are allowed to assume that two loads with the same URL represent the same resource."

The byteRange to be fetched is that "required to satisfy missing data in media data", as if there might already be media data present, but the algorithm does not seem to handle the case of all media data already being present, so I guess it is not expecting that.

But there is an out to do whatever we wish anyway:
"Although the above steps give an algorithm for issuing requests, the user agent may use other means besides those exact ones"

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: