CloudFront Serving Same Thumbnail Image for All
Unanswered
Jon Cruz posted this in #help-forum
Jon CruzOP
Hello. I can provide more details if needed, but we have a NextJS app running on an EC2 with Node v20.5. The EC2 is behind an ALB, which is itself behind a CloudFront.
The home page is an SSR that will display 20 cards. Each card contains an Image, Title, and Excerpt. We're noticing that the initial page render will show all 20 images, distinct to their article.
Upon a page refresh, all 20 images change to the same, randomly selected image. The src and srcset values all show the correct, distinct URLs, but the visible image is the incorrect one, displaying across all 20 cards.
If we disable the CloudFront cache, then the issue goes away.
Any idea if there's a NextJS setting that I'm missing? Anyone seen the same issue?
Thanks
The home page is an SSR that will display 20 cards. Each card contains an Image, Title, and Excerpt. We're noticing that the initial page render will show all 20 images, distinct to their article.
Upon a page refresh, all 20 images change to the same, randomly selected image. The src and srcset values all show the correct, distinct URLs, but the visible image is the incorrect one, displaying across all 20 cards.
If we disable the CloudFront cache, then the issue goes away.
Any idea if there's a NextJS setting that I'm missing? Anyone seen the same issue?
Thanks
1 Reply
Jon CruzOP
Update: With CloudFront cache still enabled, as it has been, we've set the "unoptimized" attribute of the <Image> component.
We're seeing the images now, no repeats.
Any idea if there's a NextJS setting that I'm missing for the <Image> Optimization and Next v13.4? Anyone seen the same issue?
We're seeing the images now, no repeats.
Any idea if there's a NextJS setting that I'm missing for the <Image> Optimization and Next v13.4? Anyone seen the same issue?