Next.js Images 304 timeout

When running a scan I get hundreds of 504 Gateway timeout errors. time to first byte 20,274 ms. however when I go visit the link to the image it loads perfectly fine. and when I visit the site the images load.,q_75/

I noticed this issue not sure if its related

also noticing IPX taking a long time

the headers on the images might be wrong? not sure whats going on

That’s because you’ve enabled pre-rendering: Netlify App


Regarding issue 1491, will discuss it with devs today and get back to you.

Regarding 304 and caching…

We checked further and it appears to be responding within reasonable timings to me, mostly within 500 ms.

The screenshot that you’ve shared appears to be the time taken to “generate” the transformed images - not the timing taken to serve every image.

For example:

If a user tries to load your image for the first time - it will trigger the function and thus, could take a second or two - depending on your image’s settings. Once the user has loaded the image and their browser has cached it, any subsequent requests to that image should be much faster.

Are you not seeing that happen? If not, could you share a HAR file recording?

Thank you!

for the IPX image function. is there a way to pre-warm the image generation? we have quite a lot of articles, and if we deploy about once a day a lot of users might experience that first image load time

No way to pre-warm unfortunately. You can use some Image CDN which can process images on-the-fly - and chances are that could be faster than IPX in some cases.