gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
9 stars 6 forks source link

webp for images is very slow #243

Closed MortenHofft closed 1 year ago

MortenHofft commented 1 year ago

Most images are parsed through the GBIF image service. It will scale the images and serve them as webp. But webp seem to be really really slow. It will often take seconds before an image is loaded. And that is on a fast connection. The time I suspect has to do with waiting for Thumbor to encode the image. I'd rather have jpg and not have to wait 3 seconds for the server to convert the image. Conversion to jpg seem to be faster?

@MattBlissett you might have a comment on this

This is what I typically see: 3 seconds waiting for the server. 100ms downloading the actual data.

Screenshot 2022-09-30 at 08 30 10
MortenHofft commented 1 year ago

I've changed the theme to use jpeg instead. Based on an average site, then the kb images goes up from 380kb to 460kb. But the time to load the images drops by 800ms.

What that means is that on slow connections, it would still be faster to use webp. And for sites with frequent visitors webp would also be faster. But I've noticed that the majority of times I visit one of the hosted portals, then the image takes forever to load. So apparently we do not cache them very long and waiting 3 seconds for the conversion is worse, than slightly more data transfer I would say.

MortenHofft commented 1 year ago

Ideally we would find a way to do proper long caching of the resources. @MattBlissett you are the most qualified for this option