this post was submitted on 11 Jan 2025
41 points (95.6% liked)

No Stupid Questions

36307 readers
1181 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 2 years ago
MODERATORS
 

Maybe it's something in UI, but many times I watch pictures (not even videos, they are their own can of worms), and want to save them, it shows me that I'm downloading them again although they are cached in whatever app I see them from.

Like this link with a happy dog: https://i.pinimg.com/736x/71/1e/52/711e52f1d6c7ead78f4380214f68c259.jpg

I see it in high rez in my browser, I can zoom in, and I can't tell any difference from a copy that I can download, but it's still, well, another download if I want to save it, and not a move from cache to my download folder, another request to the server, another waste of traffic.

Is there some rule of sandboxing for everything you load that I don't know about? In cases like our fediverse, I wouldn't like to cause double load when I already have the picture I want. Can I cut it down with some plugin in mobile Firefox?

I feel like I'm missing something big time.

top 15 comments
sorted by: hot top controversial new old
[–] zoostation@lemmy.world 16 points 18 hours ago (3 children)

It's simpler code to re-download the file than retrieve what cached version may or may not exist in memory or on disk. Developers often like to keep code simple at the expense of some kinds of efficiency, like this.

An image is usually small enough to be downloaded in no time on a fast connection, which is what developers usually have and don't stop to think that others might not have.

A video is probably being streamed so earlier segments may no longer be present locally.

[–] FourPacketsOfPeanuts@lemmy.world 1 points 2 hours ago* (last edited 2 hours ago)

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 to obtain the data if it's available locally else make the http request it was going to make anyway..

For a few hundred K image file 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 13 points 17 hours ago (2 children)

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 7 points 16 hours ago* (last edited 16 hours 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 a way of reducing complexity.

[–] spankmonkey@lemmy.world 3 points 17 hours ago (1 children)

Easy for the browser to lookup and fetch, not necessarily the process of writing permanently to the disk.

[–] gazby@lemmy.dbzer0.com 2 points 16 hours ago (1 children)

Virtually everything that's ever written permanently to disk first exists in memory though.

[–] spankmonkey@lemmy.world 3 points 16 hours 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.

[–] undefined@lemmy.hogru.ch 2 points 17 hours ago* (last edited 17 hours ago) (1 children)

Maybe I’m not understanding the question but typically a CDN will have HTTP headers to signal to the browser to cache the asset (image). I can’t imagine Pinterest isn’t using a CDN (with said headers), so if it’s re-fetched over the network that sounds like a browser problem more than a developer one.

[–] zoostation@lemmy.world 4 points 17 hours ago (1 children)

That's right, I was referring to the browser/client developer. The browser cache is treated as ephemeral storage so it's not a safe assumption that a previously downloaded file is still there.

[–] undefined@lemmy.hogru.ch 1 points 17 hours ago* (last edited 17 hours ago)

That’s crazy. I love Safari (I know, it sucks and I’m in the minority) and it usually caches things in memory and doesn’t redownload. Have I been in Appleland too long?

I’m a web developer and deal mostly with complex backend stuff, but is this issue of browsers not caching content common? This is news to me.

Edit: Omg never mind, I did misunderstand the question. It’s when saving it that it redownloads and yeah, I’ve totally noticed it too.

[–] adarza@lemmy.ca 7 points 17 hours ago* (last edited 17 hours ago)

a straight, ordinary image display in a page or tab will save to the cache, and if you then save it to disk yourself from there, firefox will utilise the cache. i see this behaviour every day on pc.

some addons will interfere with this. and cache settings, of course, do as well. there's also some ways to construct a web page that makes it harder to save an image, or doesn't save the image to the client's cache at all--requiring another hit to and download from the origin to do the requested 'save'

[–] BrundleFly2077@sh.itjust.works 2 points 13 hours ago (1 children)

I notice this with pdfs. I view a pdf in browser and then when I want to download it the damn thing has to come down again.

For what it’s worth, I recently swapped to Linux and discovered this doesn’t seem to happen there.

[–] missphant@lemmy.blahaj.zone 3 points 13 hours ago

Yeah I can't remember this behaviour either with Firefox on Linux. In fact when I save a half-loaded image to disk it will literally save just half the image.

[–] FourPacketsOfPeanuts@lemmy.world 4 points 18 hours ago (1 children)

Have often wondered this myself, would love to know the answer

[–] Ephera@lemmy.ml 3 points 14 hours ago

Yeah, sometimes I even then can't download the picture, even though I was looking at it just then, because the server can apparently tell the difference and returns an error code instead.