# Image optimization

> Large JPEG and PNG files on a static site automatically get a WebP version — at the same address.

Source: https://livops.dev/en/docs/images

When you deploy a static site, Livops makes a WebP copy (quality 80) of every JPEG and PNG over 100 KB. A browser that supports WebP (almost all of them today) gets the WebP **at the same address**; everything else gets the original. You don't need to change any links in your HTML.

- Originals are never modified and stay in place.
- A WebP is kept only when it is smaller than the original.
- If you shipped your own `photo.jpg.webp`, it is left alone.
- Responses carry `Vary: Accept`, so CDNs and browser caches never mix up the two versions.
- Files with a hash in their name (`assets/logo-3f9a2c1b.png`) are cached for a year as WebP too.

## Turning it on and off

The **Optimize images** switch is in the project settings. It is on by default for new and existing sites, and a change applies from the next deploy. The card shows what the last deploy saved, and the deploy log has a line like `rasmlar: 12 ta WebP, 8.4 MB → 2.1 MB`.

## SEO check

The SEO check flags images over 500 KB. If an image's WebP version is under 500 KB, it is no longer counted as heavy — that is what visitors receive.

## Limits

- At most 1000 images and 512 MB are converted per deploy; the rest are served as they are.
- Conversion stops after 3 minutes, and the deploy still succeeds.
- On-demand resizing (`?w=640`) is not available yet. For different screens, prepare several sizes yourself and use `srcset`.
- AVIF is not generated yet.
