Single
Trigger page-reload on new deployments
Yes it would, thats why you should only reload your interface in case there is a newer version string detected. If your frontend mailfunctions while working with an older version, than you should downgrade.
You can configure your Loadbalancer to work with sticky sessions to avoid this problem: https://medium.com/@iSooraj/how-sticky-sessions-can-tilt-load-balancers-c5dc8f50099c
7 replies
Trigger page-reload on new deployments
You said that you have multiple servers - depending on your loadbalancing strategy, it is possible that your nitro/frontend jump between Server A and Server B which can be of different versions, thus using
if (response.deploymentId != deploymentId) {
could make your frontend reload everytime you see a different version. I would try to ensure that it only reload if a HIGHER version has been detected.
I assumed you want to reload the frontend after updating it, but it seems that you want to reload the frontend whenever you update your backend.
If you build a new server+client anyway, why not just set a string with the versionnumber within the nitro endpoint. I usually set the string with the .version number of my package.json as we increase it using semantic release anyway, and its guaranteed to be a ongoing version.7 replies
Trigger page-reload on new deployments
Websocket connections are expensive, especially for such a high amount of users.
If you use them for this task ONLY, i would advice to use polling - if you have a websocket connection running anyway, you could request the version on connect as you will disconnect while restarting the backend (in case you have one).
You did not state if you have a backend running or not. If so, create and API endpoint that exposes the current active version.
If not, put a version.json in your public/ folder that holds the version information. Be sure to NOT cache this file (you might want to query it using a ?timestamp=<> querystring).
Be sure to only reload if the version goes up, not down (as your updates might not roll out at the same time).
7 replies
how to prerender route with dynamic path segment? (like generateStaticParams in next.js)
Makes sense but to be fair, how should it know all available routes.
You can ofc not pre-render dynamic pages at all and render on the client-site, with all it's downsites.
4 replies
how to prerender route with dynamic path segment? (like generateStaticParams in next.js)
Last time i checked, you had to tell nitro about every possible value in order to pre-render. Here is a guide:
https://dev.to/rafaelmagalhaes/generating-dynamic-routes-for-static-site-generation-with-nuxt-3-1epi
4 replies
CDCloudflare Developers
•Created by Single on 6/18/2024 in #pages-help
review and approve production builds
My problem is not the validation of my code - we use a staging/dev branch for that.
It's just the the build process is sometimes successful but the page still has a problem which requires us to rebuild - the exact same code. It might happen because nuxt sometime creates files with a leading "-", but it's not about finding the random problem here, its about a manual validation of the build-outcome before it goes live.
6 replies