Feedback & Ideas for server-side-rendering of next.js applications #959
Replies: 4 comments 5 replies
-
Hi @JeroenvdBurg! Thanks for this amazing feedback! Looking forward to hearing more from you and our amazing developers! ❤️ Functions and Cold Start
ISR, Images and Caching
SWA CLI
Thank you once again for your valuable feedback, and hoping to hear more from you and the other Next.js fans in the community on your honest inputs and opinions!❤️ Keep coding! |
Beta Was this translation helpful? Give feedback.
-
Missed out on replying here, thanks for your inputs! We are working on these feature enhancements for GA :) |
Beta Was this translation helpful? Give feedback.
-
Hello @Reshmi-Sriram good to see you and your team have made great progress on the SWA with NextJS :) I'm also curious about ISR, storage between servers and also ISR On-Demand revalidation, which seems to not be working, For now I have to probably utillize caching on Cloudflare and invalidate that instead, which kinda goes against what the ISR is supposed to do for us. |
Beta Was this translation helpful? Give feedback.
-
Hi folks, we rolled out major improvements to our Next.js support on Static Web Apps with support for RSC/App Dir/Server Actions, please take a look at announcement #1428. Closing this discussion, let's keep the conversation going in #1428! |
Beta Was this translation helpful? Give feedback.
-
Hi @Reshmi-Sriram @vivekjilla @anthonychu First of all congrats on this new hybrid Next.js addition to static webapps 👏 . It makes SWA really interesting for hosting next.js SSR webapps.
We have tested the new next.js SSR feature with some sample and real production apps. Overall we are impressed with the new additions regarding next.js support on Static WebApps.
We would like to share our feedback and questions on some topics:
Functions
Regarding the functions, we see some real performance difference in SSR. It looks like it is caused by cold starts of the Next_function running on the managed functions plan.
As you can see the page load times with SSR are up to 10 secs which is not really workable for a public website (this is the SSR page from the sample repository) . That's why we have some questions regarding the managed functions.
Are there plans to be able to host the next_function in a BYO function plan? In this way we can prevent coldstarts, on the premium plan you can even have always a warmed function ready.
Can you give some insight in the scaling behavior of the managed functions ?
When will a new function instance spinning up and how long is this allocated before it scales down?
Looking at the performance graph the function scales down to 0. Is that correct?
ISR & Caching
While it stated in the documentation that ISR (incremental site regeneration) is supported the feature is not really behaving like expected. When you have dynamic content which is different from the static generated (on build time) first the static is served and after refresh the dynamic content is overwriting the static content and saved in cache.
Reloads afterwards are serving directly the new dynamic content. This is the expected behavior. However after some idle time after a reload of the same page the "old" static content is again served.
This is probaly caused by the fact that the new dynamic content is cached in the next_function and is deallocated after some idle time.
This case is really business important otherwise vistors will see different content.
Vercel has this solved by saving the the .next/server/pages not on the function worker but on persistent storage. In this way the function workers can scale up & down without affecting the user experience. In our opinion ISR is only valueable when there is persistent storage of the cached pages. Is this something your team is considering (or already working on) to implement ?
Images & Caching
The same case as indicated for ISR holds for images served via the next_function with next/image. These are cached in .next/cache/images.
It would make sense to cache them outside the scope of the function, especially in combination with enterprise edge functionality so they are served from the distributed cache.
Azure SWA CLI
It is indicated on the documentation page that Deployment via the SWA CLI is not supported yet.
What are the plans to support next.js SSR in the Azure SWA CLI ?
Would it be possible to run this locally with an Azure function (hosting the next_js function) & webserver hosting the static Next.js app
Would it be possible to deploy from the CLI without using the oryx deployment?
Also from a devops perspective would it then be possibile to build the (static)app and function and deploy them separately?
Thanks in advance for your reply. 🙏
💡 Maybe it is useful to host a community call for everybody to share some feedback on this new feature and discuss roadmap/topics above?
Beta Was this translation helpful? Give feedback.
All reactions