Next.js & App Router (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
Why should you use Next.js Image Optimization (`<Image />`) over standard `<img>`?
junior LevelPerformanceDocker & Containers
In Simple Words:
The next/image component automatically optimizes images for web performance:
- Format Optimization: Converts JPEG/PNG to modern WebP or AVIF formats based on browser support.
- Responsive Resizing: Generates multiple resolution variants and sets
srcsetso mobile devices don't download 4K desktop images. - Prevents Layout Shifts (CLS): Requires explicit
width/heightorfillto reserve space in the layout before the image downloads. - Lazy Loading: Defers loading images until they enter the viewport (unless flagged with
priority).