Question

Image optimization, recomendations

I have an app loading a fair amount of images like facebook. Larger png files take a bit longer to show up and download. I’m on the $10 a month plan running an nginx reverse proxy with Node and MySQL.

Would something like s3 be better for image speed or do I just need to upgrade digital ocean and/or optimize things?

Any recommendations would be greatly appreciated.

Thanks.

Keith


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You need to do optimization of server. You don’t need to upgrade anything on DigitalOcean. You already have SSD storage, which is fastest available.

For static images or images you upload to site manually, compress it. There are many services that can do it for you. I can recommend TinyPNG. I think it’s great service for compressing PNGs and JPGs, in my case, results was great.

Little tinkering on server can help. Setup caching correctly, it can help a lot, as it stores content in clients Browser. How to Implement Browser Caching with Nginx’s header Module on Ubuntu 16.04.

You need to find a way to compress image before uploading, if end user is uploading, and you can’t use some service like TinyPNG to compress image, you need to find way to do it client/server side. There is GZIP compression, but if you go over How To Add the gzip Module to Nginx on Ubuntu 14.04 you’ll see that GZIP is not giving so much results. You can give it a try and see if it’ll go well for you, but I don’t think so. Maybe something like J-I-C ~ Javascript Image Compressor (github.com) can help, but I never used it and don’t know is it working on giving results.

You can think about setting up some CDN solution so you can delivery content to users faster. There are many services that can do that for you, free and paid. Usually I recommend CloudFlare, as it’s probably most popular and wide used service for CDN and much more.

You need to try and see does something of these help you. I hope you’ll make it work better. ;)

as @xMudrii replied, caching with nginx header module and cloudflare should do the trick.

also if your app create multiple version of images for different devices, nginx has recently released Image‑Filter module for that. that might give you some extra benefit.

https://www.nginx.com/blog/responsive-images-without-headaches-nginx-plus/

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel