PSA: just added one optimization to serve smaller image sizes to the mobile Damus client that should hopefully speed up loading times and reduce bandwidth consumption. I will not be able to do that for other clients, because all of the ones I am aware of require sha256 match. Can’t have good and high integrity at the same time. 🐶🐾🫡

Reply to this note

Please Login to reply.

Discussion

so, we can make that optional, right?

Define “optional”? What exactly are you after? If you are using Damus (your user agent is Damus) you will get redirect to a smaller variant suitable for the mobile screen (you can’t have more pixels than your screen has). URL stays the same in the note, all other clients and places and screens get the standard uploaded size. 🐶🐾🫡

Against what is the hash matched? Does the client hash the image the first time it sees it and checks afterwards?

No, on upload 🐶🐾🫡

I see. If the client only checks on upload I wonder if you could add some sort of timeout after which you start dynamically serving the image. That way the upload would succeed but you still get a performance improvement.

Some clients check the match (e.g., Amethyst, Snort [though it proxies and changes media itself without asking]) so no can do. Welcome to the land ruled by devs with wrong ideas about what client should or should not do. 🐶🐾🤷‍♂️