stackernews / stacker.news

Internet communities that pay you Bitcoin
https://stacker.news
MIT License
427 stars 108 forks source link

Our gif proxying sucks #444

Closed huumn closed 11 months ago

huumn commented 1 year ago

The majority of gifs people share timeout while being processed by the proxy. The UX is abysmal:

I've given our containers more memory and cpu in the hopes that that improves things but it'd be nice to have something that works reliabely.

SatsAllDay commented 1 year ago

Is it just because of the file size? I agree some kind of loading indicator would be ideal

huumn commented 1 year ago

It's the nature of gifs. It's like processing 100 images at once.

It seems like bumping the CPU/memory of the proxy helped some but it'd be nice to handle failure cases more gracefully

ekzyis commented 1 year ago

if they sit there we timeout and then it loads

This means they have enabled automatically to load external images, right?

We could maybe just load both requests in parallel or just drop the image proxy all together for users who would load external images anyway ("click to load external images" disabled in settings).

On another note, the current "click to load image" is also not good UX. It gives stackers no information why they have to click at all and if they know it's because of external images, we give them no information for an informed decision if they want to load that external image or not. We could at least show the external domain.


edit:

We could maybe just load both requests in parallel

that would make the imgproxy obsolete

ekzyis commented 1 year ago

GIFs are also cut off. Only first 10 frames are shown here: https://stacker.news/items/249778

ekzyis commented 1 year ago

I think we could improve performance by using lazy loading (so the image proxy does not get hit with 60+ unnecessary requests at the same time whenever someone loads Meme Monday) and using responsive images with srcset for proper optimization and scaling:

2023-09-11-223706_1920x1080_scrot

-- https://imagekit.io/website-analyzer?taskId=1694474566205&device=desktop


edit:

so the image proxy does not get hit with 60+ unnecessary requests at the same time whenever someone loads Meme Monday

this shouldn't be the case since the image requests should get cached by our CDN