Image optimisation for Laravel sites that actually ships
Resize on upload, serve the size you display, and let the browser pick the format. Three rules that remove most of the weight.
A 3 MB phone photo in a 400 px card is the single most common performance bug we find. The fix belongs in the upload pipeline, not in a manual Photoshop session.
Generate variants at upload time
When a file is uploaded, create the sizes the templates actually use — thumbnail, card, hero — and store them alongside the original. Generating on request is slower and easier to get wrong under concurrency.
Serve responsive images
Use srcset with two or three widths and let the browser choose. Always include width and height so the layout does not shift while the image loads, and lazy-load everything below the fold.
Pick modern formats
WebP is supported everywhere that matters and is typically 25–35% smaller than JPEG at similar quality. AVIF is smaller still, with slower encoding. Keep the original for downloads and regenerate variants when the pipeline changes.
Put a CDN in front
Static media should be served from a CDN with long cache headers and a content hash in the filename. For user uploads, a signed URL or a proxied controller keeps access controlled while still caching at the edge.
Audit what is already there
List your largest images and look at the display size in the template. A one-off script that regenerates the ten worst offenders is usually the fastest measurable win on an inherited site.
Frequently asked questions
Should I store originals?
Yes, one original per asset, outside the web root if possible. Variants are derived data and can always be regenerated.
Does lazy loading hurt SEO?
Not if the image is in the HTML and the layout reserves space. Never lazy-load the hero image or the main product photo.
More on this topic: Performance & SEO articles.
Admin
Related articles
Internal linking: the cheapest SEO work you are not doing
Every important page should be linked from somewhere with descriptive anchor text. It costs nothing and it compounds.
Getting a new site indexed by Google: a checklist that works
Verify Search Console, submit a sitemap, make sure nothing is blocking crawl, and then be patient. Most indexing problems are self...
How to speed up a slow WordPress site without rebuilding it
Hosting, page cache, images and plugins — in that order. Most slow WordPress sites improve dramatically before any theme work.