Excessive Data Usage: Repeatedly downloading the same file currently in cache
Categories
(Core :: Networking: Cache, defect)
Tracking
()
People
(Reporter: vinn.cente, Unassigned)
Details
Steps to reproduce:
I use the latest version of Firefox ESR, or Tor Browser; The only modification I make is disabling the disk cache, since I use an SSD and Firefox doesn't recognize that and modify its behavior accordingly. So, I view an image or page on a website, and then I try to save it...
Actual results:
But, on EVERY website, when downloading that currently displayed image or page, it is re-downloaded.
When using the image generator at NoteGPT.io, it downloads the image after it is generated, then downloads it again to display a thumbnail on the side, and then it downloads the image a third time when I actually try to save the image.
This behavior has existed for years, and the impact of wasted bandwidth from this flaw, have to be monumental!
Expected results:
When I attempt to download a currently displayed image or page, that is held in the cache, then it should just copy that to where I am specifying; Instead of using 2, if not 3, times the bandwidth necessary.
Comment 1•2 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Downloads Panel' component, but is not confident enough to move the bug to that component.
Updated•1 day ago
|
Comment 2•10 hours ago
|
||
Thank you for the detailed report, and for caring about wasted bandwidth - that is exactly the right instinct.
The behaviour you're seeing follows directly from the one change you mentioned: disabling Firefox's disk cache. The preference browser.cache.disk.enable is what allows Firefox to keep cached resources on disk. With it turned off, Firefox does not create a disk-backed cache entry at all, so there is nothing stored locally to copy from when you later save a displayed image or page - the resource has to be fetched from the network again. The repeated downloads are the intended consequence of disabling the disk cache, not a separate caching defect.
For reference, in the source:
- browser.cache.disk.enable is read by CacheObserver::UseDiskCache(): https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheObserver.h#30
- when it is false and a load would need a disk-backed entry, the cache returns "not available", so the request goes to the network: https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheStorage.cpp#51
To get the caching (and bandwidth savings) you're after, re-enable the disk cache: open about:config, set browser.cache.disk.enable back to true (its default), then restart Firefox. On the SSD concern that led you to disable it - modern Firefox is designed to be safe and measured with its cache on SSDs, so leaving the disk cache enabled is recommended.
Since this is working as designed rather than a defect, this is being resolved as INVALID. Please don't hesitate to reopen or file a new bug if you still see repeated downloads with the disk cache enabled - that would be a genuinely different situation worth looking into.
Thank you again for taking the time to report this.
Description
•