Performance
How We Cut a Photography Site from 203 MB to 10.6 MB
Onaivio studio
· 2 min read

Images are usually the heaviest thing on a website, and on a photographer’s site they are the whole point. When we rebuilt P Media, the old site downloaded more than 200 MB of photos. Here is the playbook that brought it to 10.6 MB with no visible loss.
Rule 1: never serve the original
Camera files are 6000 pixels wide. A phone screen needs around 1200. Generate several widths (for example 640, 1080, 1600 and 2400) and let the browser choose with srcset and sizes. In Next.js the Image component does this for you; your job is to set an accurate sizes value.
Rule 2: smallest encoding wins
AVIF is usually the smallest, WebP is close behind, and a well-tuned JPEG sometimes beats both on grainy photos. Rather than picking one format for everything, encode each image all three ways and keep the smallest. This single rule did more than any other change.
Rule 3: lazy-load everything below the fold
Only the first screen of images should load immediately. Mark the hero as priority so it is fetched early, and let the rest load as the visitor scrolls.
Rule 4: reserve the space
Always give images width and height (or an aspect ratio) so the page does not jump as they arrive. That protects your CLS score.
Rule 5: write alt text for people and search
Alt text is how screen-reader users experience your images and how Google Images understands them. Describe what is in the picture and why it matters: "Bride and groom at a Lagos wedding reception, photographed by P Media" beats "IMG_4821".
The checklist
- Resize to several widths; never ship originals
- Encode AVIF, WebP and JPEG; keep the smallest
- Priority-load the hero; lazy-load the rest
- Set dimensions or aspect ratios on every image
- Descriptive, specific alt text
- Serve from a CDN with long cache headers
Want the same treatment for your site? Performance work is part of every Onaivio build.


