Hello, hurray, and welcome to a new year ๐๐
Welcome to yet another episode on the features and concepts of next.js, the first and second publications could be found in https://obasivera.hashnode.dev/concepts-and-features-of-nextjs and https://obasivera.hashnode.dev/concepts-and-features-of-nextjs-2 respectfully.
Introduction
This article is focused on explaining the Network which is a concept that focuses on explaining where our application codes are being stored to make them more accessible when they are being requested by the client side which is the browser.
THE NETWORK
This is seen as interconnected servers that can exchange, receive and share resources. so here network basically refers to how your application codes are being stored and distributed to become easily accessible it can be when it is being requested.
Our codes could be distributed and stored in the
Origin Server
Content Delivery Network (CDN)
The Edge.
The ORIGIN SERVER :
This refers to the main server or computer that stores and runs the original version of the code, such that when a request is made to the server, it compiles a response and moves to a content delivery network.
The CONTENT DELIVERY NETWORK (CDN)
This basically stores static contents that include HTML and Image files in multiple locations across the world and then they are placed just in between the client and the origin server so that once a new request comes in the closet CDN to the request can respond with the cached result, making for faster content delivery.
THE EDGE:
This stores content at the edge of the network and is distributed to different locations around the world.
This is very similar to CDN, but it has an added advantage because it could also run some extracts of code.
So what this basically means is that both caching and execution of code can be performed in the edge and this greatly increases performance, reduces the amount of codes to be sent to the client's browser, and reduces latency.
it is very important to note that you can store your codes in The Edge using MIddleWare.
Conclusion
Given that there are different methods of storing our application codes, with each presenting its own unique definition, this has mainly added to make it more interesting and has also made for easy accessibility of requests