Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kinggs's avatar

Best strategy for hosting assets

Hello. I'm currently managing an ecommerce store built on Laravel featuring thousands of products. When adding a product, we store the image, create multiple sizes, watermark them and host them all in DigitalOcean Spaces. This causes massive headaches with maintainability, for example if we want to add a new image size or a watermark.

Is there a better way, from a maintenance point of view to host these assets? Should we stick to creating thumbnails during upload and storing in cloud object storage, or would it be better to spin up a new DigitalOcean droplet, host the assets there and then use a CDN such as Cloudflare or BunnyCDN to do the resizing, watermarking, etc?

Just curious to know what other people are doing and/or if there is anything within the Laravel ecosystem that helps with this. Any advice would be massively appreciated. Thanks

0 likes
3 replies
Snapey's avatar

have a look at imagekit.io.

You can store the image in the original format, and then they will create versions on the fly as they are accessed. It then also caches the result and acts as a CDN.

kinggs's avatar

Hi. Thanks for your suggestion. We looked at Imagekit previously. However some of our products fall under swimwear and underwear (we're a department store) and Imagekit were unable to offer us a solution for that reason.

martinbean's avatar

@kinggs Just store the original asset, and then use Glide to serve appropriately-sized thumbnails where needed. Glide will cache conversions so you’re not needlessly recreating the same thumbnails over and over again. You can pair this with a CDN so that requests don’t even hit your server at all.

Please or to participate in this conversation.