It’s simpler code to re-download the file than retrieve what cached version may or may not exist in memory
This seems incredible
There would already have to be a data layer that serves the main web page renderer. That layer would already have to handle looking in the cache or making an http request in event of a cache miss. It would seem almost trivial for a UI operation like ‘save to disk’ to simply call that layer obtain the data…
For a few hundred K image I can understand why some might not bother, but I’ve seen this behaviour where a browser already has an MP4 cached (such that it can replay any part of it without subsequent http traffic) and yet it still makes a new request when saving. It’s weird to be honest…
gazby@lemmy.dbzer0.com 1 week ago
If it were difficult or time consuming to lookup or fetch items from the cache, it’s not a very effective cache 😬
zoostation@lemmy.world 1 week ago
It’s more about keeping the downloads code independent from the cache code. Once one depends on the other, you can’t change either one without considering the other. Minimizing dependencies is the kind of complexity it’s good to avoid.
spankmonkey@lemmy.world 1 week ago
Easy for the browser to lookup and fetch, not necessarily the process of writing permanently to the disk.
gazby@lemmy.dbzer0.com 1 week ago
Virtually everything that’s ever written permanently to disk first exists in memory though.
spankmonkey@lemmy.world 1 week ago
If the system isn’t built to move it from memory to the disk then it isn’t easy to just move it over. The browser might have the file stored in a way that makes it easy to stop and fastforward or even allow it to play or partially load,. Trying to save a file that might be incomplete is far more complicated than a good old reliable direct download.
Think of it like orange juice. The browser may have stored it in a wide shallow bowl because that works better for the browser, but it would be a pain in the ass to pour into a small cup. Much easier to just pour a new cup of orange juice when it is in an expected format.