Skip to content

[next/image] Repeated images rerender on every page switch. #19074

@DaniHv

Description

@DaniHv

Bug report

Repeated [Next/Image] included images rerenders when switching between pages even if has been already used in components like layout/header.

Describe the bug

When including an image using next/image, in every page switch it rerender even if was rendered before, like a Header component with logo.

If we see the network tab in developer tooks, we can confirm that isn't a "thing" related to network/cache because the image/assets isn't downloaded multiple times.

Personally, actually don't know how exactly next/image works, but with the Gatsby equivalent (gatsby-image) it didn't happen using a similar "repeated component" approach.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to 'https://mhhk5.sse.codesandbox.io/'
  2. Click on 'Go to first page / Go to second page'
  3. Repeat multiple times step 2 quickly

Expected behavior

The image shouldn't rerender, and works like a normal .

System information

Not necessary, because was tested on Vercel, Codesandbox and my own PC

  • OS: Windows 10
  • Browser: Edge/Chrome Last version
  • Version of Next.js: 10.0.1 / 10.0.2-canary.8 (Tested in both, same result)
  • Version of Node.js: 14.7.0

PD: Sorry if my english isn't good enough.

Metadata

Metadata

Assignees

Labels

good first issueEasy to fix issues, good for newcomers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions