If your Laravel app lets users upload images and sends them straight to S3, there is a good chance you are storing files much larger than they need to be.
This is easy to miss. The upload works, the image renders, and nobody thinks about it again. But over time, unoptimized JPEGs and PNGs can quietly increase page weight, CDN traffic, and storage costs.
In this walkthrough, we will build a small image optimization pipeline for a Laravel app:
User upload ──▶ S3 ──▶ queued Laravel job ──▶ ShortPixel ──▶ optimized image ──▶ S3
Enter fullscreen mode






