Next.js Discord

Discord Forum

Image is loading with a delay

Unanswered
Catalan Sheepdog posted this in #help-forum
Open in Discord
Catalan SheepdogOP
Need urgent help.

I am developing an e-commerce site. On the product details page, the product image is taking a significant time to be seen on the screen. This issue only happens on a first-time visit.

I have tried priority='true' and loading='earger'. But still not fixed.

Sample page: https://fejmo.com/product/leather-shoulder-bag-16992606959mMnL

Test Result: https://pagespeed.web.dev/analysis/https-fejmo-com-product-leather-shoulder-bag-16992606959mMnL/xcbnszkj60?form_factor=mobile

Please anyone help me diagnose/fix this issue? Thanks in advance.

18 Replies

@Ray do you have sharp installed?
Catalan SheepdogOP
no
@Catalan Sheepdog no
try installing it
@Ray Click to see attachment
Catalan SheepdogOP
link please
npm install sharp --save
Catalan SheepdogOP
Oh my bad! Now I have checked, I installed it earlier, it is also installed in production server and live now.
@Ray `npm install sharp --save`
Catalan SheepdogOP
Sorry, I was looking for the link of the screeenshoted doc page link
do you use something like pm2? or just npm run start?
@Ray do you use something like pm2? or just `npm run start`?
Catalan SheepdogOP
I am using custom server. So I start application with the command `node server.js
@Ray do you use something like pm2? or just `npm run start`?
Catalan SheepdogOP
I don't have any idea about pm2
I would say try using pm2
if you npm run start, it will just start one process of node
@Ray I would say try using pm2
Catalan SheepdogOP
okay... let me try
Catalan SheepdogOP
okay. Now how can I optimize image laoding time using pm2?
just start the server with pm2 so your server can handle multiple request in a time