4 ms·
One thing we found really helpful for optimizing our images was building our own internal image CDN service. Our image URLs look like this: imgsvc.example.com/
by lwansbrough 5y ago
One thing we found really helpful for optimizing our images was building our own internal image CDN service.
Our image URLs look like this: imgsvc.example.com/url/size(64),fit(cover)/{url}/image.png where url is the source image. This ends up being the image src URL used in production. We have a domain whitelist so it can’t be too badly abused. We can change any number of parameters. You can see here I’m setting the fit and size and image format (.png). There’s even an option to fit the image to a bytes budget. It’s invaluable not having to think about source image sizes, we just drop whatever image we have into an Azure bucket and drop the URL into that service.
- slver 5y agoYou can make sure it's not abused at all if you sign the URL. In terms of performance it's a free feature because once the image is generated, you no longer have to check the signature (you only check it first time to generate).