Closed Bug 714464 Opened 14 years ago Closed 14 years ago

Should not cache flash request file.

Categories

(Core :: Networking: Cache, defect)

12 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dindog, Unassigned)

References

()

Details

Cache file like video of Youtube flash player is a waste. And it seem only Firefox doing that. Steps to Reproduce: 1. Clear Cache. 2. Open a flash site with media file request...say any YouTube video page. 3. After the video is loaded, you can observe that the cache directory of Firefox is exactly the size of the video file... It's almost useless because: 1. Flash player don't rely on these to play, but some duplication video can be found in system TEMP folder ---- files name as "fla****.tmp" 2. Reload Flash player page, same video will be request again... it mean cache these has no meaning... ************************************************************ I also test with IE6 and Chrome 17, the temp folder of both didn't become bigger as Flash video downloading.
Add an URL of Transformers trailer with 1080p. The STR stand in any Flash page, but of course bigger video make it more prominent. This trailer in 1080p is about 61MB. You won't miss that :) I also found that the temp file in System temp folder is not always name "fla***.tmp", in this trailer, is a subfolder name "mozilla-media-cache" in system folder. And reload this page don't trigger a new request, but it still rely on the file in system temp folder, not Firefox cache.
correction: subfolder name "mozilla-media-cache" in system folder. I mean system temp folder (aka %temp%)
- regular data the is downloaded while you surf, is stored in the disk-cache or the memory-cache, depending on the actual HTTP-headers that are send back. - downloads are first stored as *.tmp files in the cache, and later (when you've answered the file-save dialog box), moved to their final destination. Yes, this means that files are being downloaded even before you've chosen a name for it. - mozilla-media-cache is used by the browser for media files handled by the browser itself, not using a plug-in. That means that it's used for HTML5 files. Media files aren't stored in the cache, because they're only necessary for local use (moving backwards and forwards through the movie for instance), without occupying space in the cache or in memory. They're also wiped out when you go to a different page, or when you close the browser. - the file fla****.tmp is chosen by the Flash plugin - it's a temporary file used by the plugin, and the browser doesn't even know what it is, and it is for. It will disappear when you go to a different page, or when you close the browser. I don't know exactly what mechanism Flash uses, but you have to know that Flash can play files larger than the disk cache or memory cache (complete movies), so they can not store the movie in the browser somewhere, and expect that it will still be there when you go backwards or forwards. In fact, until recently Mozilla didn't even store files larger than a few megabytes exactly to make sure that they didn't blow the cache away. That isn't necessary anymore since the cache now defaults to 1GB. But Flash still has the mechanism to store the movie outside of the cache, to make sure it would have access to it. That also helps for people that do not use a disk-cache at all. In short : this is an issue for the Flash plugin itself, although a real solution would probably require a change in the API. If the plugin knows that the data is in the disk-cache (or even mozilla-media-cache), then they wouldn't need to create such a fla****.tmp file.
(In reply to Jo Hermans from comment #3) > In short : this is an issue for the Flash plugin itself, although a real > solution would probably require a change in the API. If the plugin knows > that the data is in the disk-cache (or even mozilla-media-cache), then they > wouldn't need to create such a fla****.tmp file. "mozilla-media-cache" folder is created by YouTube flash player, not firefox. Again, Firefox store the file in its cache folder, but nobody used it. Everything Flash player need is in system temp folder, Firefox cache them don't make sense
(In reply to Jo Hermans from comment #4) > The signature parameter is different. That's obviously something that the > browser can't really control, and that's why you saw a re-download of the > same data. Most video site make a new requests return different URL. But Youtube is kind of different in this page. You can do it again, setting the resolution to 1080p, wait the whole video download, clear firefox cache, refresh, setting the resolution to 1080p, you don't need to download again... YouTube knew there was a cache in your harddrive, in system temp folder, not firefox cache file. In short, whether the Flash player use cache, firefox's cache is useless, it all depend on system temp folder.
(In reply to dindog from comment #5) > "mozilla-media-cache" folder is created by YouTube flash player, not > firefox. Again, Firefox store the file in its cache folder, but nobody used > it. Not true. It's created by the browser - see bug 475441.
(In reply to Jo Hermans from comment #7) > Not true. It's created by the browser - see bug 475441. I don't get it, why some name fla***.tmp and some in mozilla-media-cache folder (even in youtube)? Anyway, we still use cache in %temp% folder, copy to firefox cache folder got no real meaning, but it took a considerable space of cache, that mean the really useful cache will be deleted to give way for these "video cache"
You have a 1GB cache, does it really matter ? The limit for large files has recently been increased, because lots of people kept complaining that they need to download them over and over again. And that's what a cache is for. Ok, in this particular example (comment 4), the cache would not help, since the URL was changed. But the browser can't know that - the webserver can improve their behaviour by trying to ensure that their files can be cached (same URL, correct HTTP-headers, ..)
(In reply to dindog from comment #8) > (In reply to Jo Hermans from comment #7) > > Not true. It's created by the browser - see bug 475441. > > I don't get it, why some name fla***.tmp and some in mozilla-media-cache > folder (even in youtube)? You're probably using some HTML5 code on this page (you have to opt in on HTML5, youttube doesn't send it by default) ? > Anyway, we still use cache in %temp% folder, copy to firefox cache folder > got no real meaning, but it took a considerable space of cache, that mean > the really useful cache will be deleted to give way for these "video cache" The fla****.tmp file in the %temp% folder is NOT part of the cache - it's created by Flash, probably to server as a buffer for supporting backwards/forwards movement. And it's not a complete copy of the movie, it's limited to a certain size I think, otherwise you would have trouble if you're watching huger videos (over 1 GB for instance). This is just like Firefox would do in the mozilla-media-cache folder, but in that case, the file would not have been stored both in the regular disk-cache and in the media-cache (Firefox knows to avoid it). Flash doesn't know about that, or is not able to control that (not part of the API I think).
(In reply to Jo Hermans from comment #9) > You have a 1GB cache, does it really matter ? The limit for large files has > recently been increased, because lots of people kept complaining that they > need to download them over and over again. And that's what a cache is for. > > Ok, in this particular example (comment 4), the cache would not help, since > the URL was changed. But the browser can't know that - the webserver can > improve their behaviour by trying to ensure that their files can be cached > (same URL, correct HTTP-headers, ..) And that is why I file this bug, nothing download in firefox's cache can be reused. It disobey the concept of "CACHE". Beside, comment4 is not a particular example, it is universal in my every try, every video share sites (no HTML5 involves): 1. Flash player play file in %temp%, not Firefox cache folder. (clear fx cache won't affect playing) 2. Any flash media cache can reuse is in %temp% folder, not Fx cache folder it doesn't matter flash plugin creates them or firefox does. (In reply to Jo Hermans from comment #10) > The fla****.tmp file in the %temp% folder is NOT part of the cache - it's > created by Flash, probably to server as a buffer for supporting > backwards/forwards movement. And it's not a complete copy of the movie, it's > limited to a certain size I think, otherwise you would have trouble if > you're watching huger videos (over 1 GB for instance). It's complete file.. as least it's the case when the whole video size less than 300MB (it's cut into multipart, but every part did save in %temp%), I see flash TV show a lot... and I put both Firefox and %temp% in a 2GB RAMdrive, that how I discover this issue: Windows kept tell me the disk is full, and CACHE = 1GB, TEMP = 1GB.
We use our standard cache rules for all HTTP content when determining whether to save any particular resource in cache. Plugins (or non-plugin video) are no different than any other kind of media. And there are plenty of cases where we do want to cache HTTP files loaded by plugins, and we don't really know from context whether this is a file that ought to be cached or not. The disk space usage doesn't really hurt anyone, because we size our cache based on available disk space. So I'm going to WONTFIX this request.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.