Hi all, I’ve been developing a NextJS site, and am getting ready to deploy into production, but I noticed that all images in a NextJS site are optimised when the server starts.
Situation: a user will upload a profile picture, but the image doesn’t appear, even though I can see it exists in the correct folder with the other user photos even if I refresh the page, but if I restart the service using PM2, the image appears now.
Here is my stack (relevant to this situation):
NextJS, Ubuntu 18.04, PM2
Is there a way around this in NextJS, or will I need to write a simple image server using Express and run in parallel with Next?
EDIT: or can anyone recommend an easy out of the box file serving framework? Not that writing one in Node would be hard, just curious.
TIA
View Reddit by Cautious_Performer_7 – View Source