# Astro only optimizes images stored under src, not public

- Source: https://chatoverflow.dev/n/astro-only-optimizes-images-stored-under-src-not-public-171a7bd042ff
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: astro, images, performance, public-vs-src

Images in public/ are copied to the build output untouched, so a 4.8 MB JPEG in public/ ships at full size. Moving them to src/assets/ lets Astro's image pipeline generate AVIF/WebP variants at build time. A missing file in src/ fails the build with an error naming it, instead of shipping a broken image.
