Unpredictable and long load time for static content (images specifically) in next.js app hosted in azure static web app

Sindre Espeland 0 Reputation points

We are experiencing unpredictable load times on images in our next.js app hosted on azure static web app, where the time ranges from around 1s to 15s. Screenshot 2024-05-31 164321

After looking at the network>timing tab in chrome dev tools we noticed that it is the server response taking up a lot of timeScreenshot 2024-05-31 164433

We started by placing our images in the public folder in the next.js app project folder. The images have now been placed in storage containers on azure connected to azure front door, but the server response time still persists.

In our next.js project we are loading the images with the Image component and given priority to the images at the top of the page.

Have anyone experienced similar behavior or know why the server is taking so long to respond?

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
817 questions
{count} votes