Next.js image optimiser defaults leave AVIF disabled and serve JPEG to some browsers
A developer audited the default image optimisation endpoint of their Next.js 16 site and found it accepts only 15 preset widths and a single quality value. Requests for any other width or quality are rejected with a 400 error, a restriction added in Next 15.4 to prevent cost abuse. AVIF support exists but is not enabled, so browsers that request AVIF but not WebP receive a re-encoded JPEG, which is about 53 per cent larger than the WebP served to other browsers. The author notes that enabling AVIF is a one-line config change that would likely reduce file sizes by 20 to 30 per cent. The endpoint also blocks SVG processing and remote hosts by default, which the author describes as protective defaults that were never explicitly chosen.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in