And that's something that if we want the server to generate that content to have a better performance, we can't do that. So to overcome those two scenarios or doing a mix of those two scenarios, we have the edge, which is a new concept and the idea of the edge is to have a distributed network architecture that processes the data as close as the source or the users to minimize this bandwidth that we were mentioning before.
So the idea is to replicate the server-side rendering on this original approach that we have, but closer to the users using the same approach that we use for the CDNs and also the same distribution of the edges and the different servers across the world.
So in this case, this is an example image from one of the examples of this edge networks. This is from AWS, but we will have CDNs with these servers that are hosting the static content, but in the same networks, in the same regional networks, we will have also edge computing servers that will execute server logic closer to the users.
So in this case, we can use the edge for different scenarios like personalization in the case that we want to send custom content to the different users. We can use geolocation to identify where the users are visiting our website from and create dynamic content based on that. We can implement approaches of AV testing in the case that we want to test different approaches on our projects, we can do that based on this dynamic content that we can generate with the edge computing. And then we can add authentication or security to the content of our websites. So we can manage static content but also dynamic content using the same edge network that we generated.
I will mention some of the frameworks that allows you to work with edge computer and as we are in a React conference, I will mention React frameworks. The first example that I wanted to mention is NexGIS. NexGIS offers edge functions which are basically scripts and functions that can execute server-side rendering code, so they are small pieces of code that can execute these functions on the edge with server-side rendering, but using the same network, or the same approach that we use for CDNs. In order to execute these functions you will need your hosting provider to allow you to do that.
The main hosting providers offer different approaches, but they offer edge computing like Bercel, Netlify, AWS, etc. We can also use what is called the middleware. The middleware is an intermediate layer or tier that can execute custom logic before a request is processed. In the case that you are using Next.js for static site generation and static content, you can catch all the different requests before you deliver the static content to the users, and then you can execute custom server-side logic before actually returning the content. So you can add custom content or you can add dynamic content to what you are returning to the user based on that.
And another framework, another React framework that we can mention is Remix. Remix's approach is basically focused on the server-side rendering, and they use what they call the Next.js Generation edge. So the idea with Remix is that you can choose between a Node.js runtime or an edge-oriented runtime on a per-route basis. So depending on the routes that you are going to manage on your website, you can execute server-side logic using a Node.js runtime or an edge function, or a worker, or, well, again, the different names that the different hosting providers offer you for this edge computing logic. So the idea is that you can execute server-side logic as close as possible to the end users that are visiting your website.
So thank you very much. Let's keep in touch, and we can continue talking about the edge or any other topic.
Comments