Skip to content

Unexpected high number of image optimizations #81893

Answered by Yasir-Rafique
canta2899 asked this question in Help
Discussion options

You must be logged in to vote

Hey, you’ve done a fantastic job digging into this! This is one of those tricky corners of the Next.js + Vercel ecosystem where things can get a little frustrating, especially when mixing authentication, private images, and the built-in image optimizer.

The optimizer essentially acts like a new client. It fetches your image using only the info in the 'src' URL with no auth. This is by design for performance/scalability, but it does make protecting private images tough.

You would need to optimize images before upload, or use something like CloudFront (you mentioned) or a dedicated image proxy with signed URLs

There is no “perfect” way to have both secure, authenticated private images and u…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@canta2899
Comment options

@Yasir-Rafique
Comment options

Answer selected by canta2899
@canta2899
Comment options

@Yasir-Rafique
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants