Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<audio> and Mozilla Firefox Cache issue

I have the next html code

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

        sound.play();
    }
</script>

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

audioCaptcha is path to my audio storage, which return 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"

As workaround I can use soundUrl with random parameter, e.g. audioCaptcha?12345, but I hope that there are more adequate solution.

Network statistic: Network statistic

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. I want turn off this possibility.

like image 540
Evgeny Mironenko Avatar asked Feb 23 '26 07:02

Evgeny Mironenko


1 Answers

I submitted this issue to Firefox bug tracker and it was confirmed. You can track the status here: https://bugzilla.mozilla.org/show_bug.cgi?id=1129121

like image 56
Evgeny Mironenko Avatar answered Feb 24 '26 22:02

Evgeny Mironenko