Prompt
I'm building a marketing site and want the simplest image optimization setup
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
For the simplest image optimization setup on a marketing site, I’d recommend this:
Best minimal setup
Use responsive images + modern formats + lazy loading.
1) Serve images in modern formats
Use:
- AVIF first if possible
- WebP as fallback
- PNG/JPEG only when needed
If you’re using a framework or build tool, let it generate these automatically. If not, create optimized versions manually.
2) Use srcset and sizes
This lets the browser choose the right image size for the device.
<img
src="/images/hero-1200.jpg"
srcset="/images/hero-600.jpg 600w,
/images/hero-1200.jpg 1200w,
/images/hero-1800.jpg 1800w"
sizes="(max-width: 768px) 100vw, 1200px"
alt="Marketing hero image"
loading="lazy"
width="1200"
height="800"
/>
3) Lazy-load below-the-fold images
Add:
loading="lazy"
Use it for images not visible immediately.
Don’t lazy-load your main hero image.
4) Always set width and height
This prevents layout shift and improves performance.
5) Compress images before upload
Even a simple process helps a lot:
- Resize to the largest display size you actually need
- Compress with a tool like:
- Squoosh
- ImageOptim
- TinyPNG
Simplest practical stack
If you want the easiest hands-off option:
- Next.js: use
next/image - Astro: use its image integration
- Static site: use a CDN/image service like:
- Cloudinary
- Imgix
- Bunny Optimizer
If you want the absolute simplest answer
For a marketing site, do this:
- Upload images at the correct size
- Convert to WebP/AVIF
- Use
width,height, andloading="lazy" - Put images behind a CDN
That’s enough for most marketing sites.
If you want, I can give you:
- a minimal HTML example
- a Next.js setup
- or a Cloudinary-based setup