Menu

Our image optimiser offers 15 widths and one quality, and answers an AVIF-capable browser with JPEG
📰

Our image optimiser offers 15 widths and one quality, and answers an AVIF-capable browser with JPEG

DEV Community: nextjs·Daniel Pertu·2 days ago
#jBpgZQr5
#devtonextjs#devto#dev#webp#next
Reading 0:00
15s threshold

Earlier today I established that the three photographs on our landing page are JPEGs with a .webp extension. One of them is used through next/image , which means it passes through /_next/image on the way to the visitor, and that endpoint turns out to be interesting on its own.

It takes three parameters: url , w , q . Our next.config.mjs has no images key in it at all, so everything below is a Next 16.2.7 default that we never chose, and all of it is discoverable from outside with curl .

15 widths, and the 400 that tells you so

curl -s "https://pub-trivia.app/_next/image?url=%2Fdemo-1.webp&w=1201&q=75"

Enter fullscreen mode

Exit fullscreen mode

Bad request

INVALID_IMAGE_OPTIMIZE_REQUEST

Enter fullscreen mode

Exit fullscreen mode

84 bytes, no HTML.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.