[TOC]
This example demonstrates best practices to serve your images through next.js
built-in image serving feature.
For best performance, put images in it's own folder other than public
. This will prevent duplicate precaching entries in the sw.js
service worker script. Then import Image from 'next/image'
to use the Image
component provided from next.js
in your app.
cd examples/next-image
yarn install
yarn build
yarn start
**/public/workbox-*.js
**/public/sw.js