Skip to content

Instantly share code, notes, and snippets.

@dbredvick
Created January 3, 2022 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbredvick/dbdd0f8caafd2fd83a55c3252ed1a8e0 to your computer and use it in GitHub Desktop.
Save dbredvick/dbdd0f8caafd2fd83a55c3252ed1a8e0 to your computer and use it in GitHub Desktop.
Next.js Image caching / correct headers
// --- ✅ better caching
import imageSrc from '../public/images/image.png'
import Image from 'next/image'
return <Image src={imageSrc}/>
// --- ❌ worse caching
import Image from 'next/image'
return <Image src="/images/image.png"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment