nextjs - 💡(How to fix) Fix Optimizing Image-Heavy Pages with Next.js and Vercel Without Layout Shifts [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#87265Fetched 2026-04-08 02:07:27
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
closed ×1commented ×1issue_type_added ×1labeled ×1

Code Example

no info for this
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

australiacityguide

To Reproduce

Hello,

I’m working on a content-heavy Next.js project deployed on Vercel, where each page includes multiple high-resolution images, dynamic content sections, and interactive elements. We’ve been facing several performance and rendering challenges:

Pages with multiple images experience slow load times, affecting Core Web Vitals scores and overall SEO.

Implementing next/image with lazy loading sometimes causes cumulative layout shifts (CLS), especially on pages where images load asynchronously.

Managing image metadata for SEO for my website australiacityguide.com.au (alt attributes, structured data) across dynamically generated pages is cumbersome, particularly when using getStaticProps and getStaticPaths.

Edge caching and incremental static regeneration (ISR) sometimes conflicts with large media assets, delaying content updates.

Here’s a simplified snippet of the current implementation:

Current vs. Expected behavior

// pages/[city].js import Image from 'next/image'; import { getCityData } from '../lib/cities';

export default function CityPage({ city }) { return ( <div> <h1>{city.name}</h1> <p>{city.description}</p> {city.images.map((img, index) => ( <Image key={index} src={img.url} alt={img.alt} width={800} height={600} priority={index < 2} // Only first two images are priority loaded /> ))} </div> ); }

export async function getStaticPaths() { const cities = await getCityData(); return { paths: cities.map(city => ({ params: { city: city.slug } })), fallback: false }; }

export async function getStaticProps({ params }) { const city = await getCityData(params.city); return { props: { city } }; }

Provide environment information

no info for this

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

Questions:

What are best practices for serving multiple high-resolution images efficiently in Next.js without negatively impacting load times or CLS?

How can next/image be combined with modern lazy loading, caching, or edge strategies on Vercel for large, dynamic content pages?

Are there recommended patterns to automate SEO-friendly alt text and structured data for images generated dynamically via getStaticProps?

Any guidance or insights from developers who have handled image-heavy, dynamic Next.js deployments on Vercel would be highly appreciated.

extent analysis

TL;DR

Optimize image loading and caching strategies in Next.js to improve performance and reduce cumulative layout shifts (CLS) on dynamic pages with multiple high-resolution images.

Guidance

  • Consider using next/image with lazy loading and priority loading for critical images to reduce initial load times and improve CLS.
  • Implement edge caching and incremental static regeneration (ISR) strategies on Vercel to reduce the load on the origin server and improve content update times.
  • Automate SEO-friendly alt text and structured data for images by integrating metadata management into the getStaticProps and getStaticPaths functions.
  • Explore using image compression and resizing techniques to reduce the file size of high-resolution images and improve page load times.

Example

// pages/[city].js
import Image from 'next/image';
import { getCityData } from '../lib/cities';

export default function CityPage({ city }) {
  return (
    <div>
      <h1>{city.name}</h1>
      <p>{city.description}</p>
      {city.images.map((img, index) => (
        <Image
          key={index}
          src={img.url}
          alt={img.alt}
          width={800}
          height={600}
          priority={index < 2} // Only first two images are priority loaded
          loading="lazy" // Add lazy loading for non-priority images
        />
      ))}
    </div>
  );
}

Notes

The provided code snippet and environment information are limited, so these suggestions are general and may require further customization to fit the specific use case.

Recommendation

Apply workaround: Optimize image loading and caching strategies, and automate SEO-friendly alt text and structured data for images, to improve performance and reduce CLS on dynamic pages with multiple high-resolution images. This approach allows for incremental improvements without requiring a full overhaul of the existing implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Optimizing Image-Heavy Pages with Next.js and Vercel Without Layout Shifts [1 comments, 2 participants]