Hacker News new | ask | show | jobs
by benatkin 1701 days ago
It's similar to generating compressed files with the build. I think it belongs on the web server layer.

Here's an open source, self-hosted one, that should be easy to integrate with Next.js:

https://github.com/willnorris/imageproxy

To define a custom one, you need only provide a function:

https://nextjs.org/docs/api-reference/next/image#loader