Esat Artug5 min read
Before diving into the edge functions, let's start talking about edge computing and how we came to edge computing.
For the last years, everyone is started talking about the edge. It became the next big thing after cloud, IoT, and blockchain.
In the beginning, the first computers were big, isolated computers that people could only access directly. Then we had personal computers. Personal computers could do computing in a much more distributed manner. At that time, data was saved on a user's computer locally.
Next, cloud computing came into our lives. Cloud services are infrastructure, platforms, or software that are hosted by third-party providers and made available to users through the internet.
However, due to the distance between clients and the data centers where cloud services are hosted, cloud computing can cause delays. For this reason, edge computing entered our lives.
Edge computing is a networking philosophy focused on bringing computing as close to the source of data as possible in order to reduce latency and bandwidth use. In simpler terms, edge computing means running fewer processes in the cloud and moving those processes to local places, such as on a user's computer, an IoT device, or an edge server. Bringing computation to the network's edge minimizes the amount of long-distance communication that has to happen between a client and server.
First Computing: One centralized computer running applications and storing data locally
Personal Computing: Decentralized computers running applications and storing data locally
Cloud Computing: Centralized computers running applications and storing data in data centers
Edge Computing: Centralized computers running applications and storing data close to users - either on the device itself or on the network edge
What Are Edge Functions
This enables development teams to more easily deliver a number of features such as A/B testing, custom authentication, dynamic routing, personalization, and more.
Edge Functions are aimed to make the developer experience easier by allowing you to:
personalize web content
The Main Benefits of Edge Functions:
Lower latency is the major benefit of edge functions when it comes to improving the overall performance of your products.
Users of all web apps will experience delays when they face processes requiring communication with an external server. The length of these delays will vary depending on the server's available bandwidth and location, but they can be eliminated entirely by moving more operations to the edge.
Because Edge Functions run on the content delivery network edge node closest to the user, they have lower latency than other options.
Edge SEO is a field of technical SEO that utilizes serverless (edge) technologies to execute changes to code through using the CDN as a form of middle-ground in which SEO hotfixes and recommendations can be implemented. These changes are agnostic of the website infrastructure (origin source code) and are supported by multiple CDNs through "edge functions" technology.
As it's described earlier, edge functions close the gap between the user and the data source.
Using the edge functions in the website will bring a couple of benefits, such as:
improved site security
possibility to perform A/B testing
Use Cases for Edge Functions
Basically, you can do anything and everything with edge functions. Since you'll be writing code, possibilities will be infinite. Here are just a few use cases for edge functions:
Experimentation: Use edge functions to process and analyze customers' data at the edge in real-time.
Personalization: Increase conversion rates by delivering content that automatically tailors based on each user's location and other signals.
Security: Distribute your data across the edge locations with edge functions to distribute and reduce the risk as well.
Authentication: Deliver fast authentication with edge functions by caching and verifying credentials at the edge.
Personalization with Vercel Edge Functions and Ninetailed
Ninetailed is an API-first optimization platform that works with Contentful and other headless CMS platforms. It includes SDKs for Next.js and Vercel Edge Functions to make it simple to integrate personalization on the edge.
This short guideline walks you through setting up and integrating Ninetailed and Next.js with Edge Functions. In this guide, you'll find:
How to install the SDK for Next.js with Edge Functions
Steps you need to follow to personalize components in Next.js
Step 1: Install Ninetailed SDKs for Next.js and Edge Functions
With the Next.js SDK, you can add dynamic content for personalization to any component. In this step, you need to install Ninetailed SDKs for Next.js
Install module via yarn:
Step 2. Add Ninetailed to the middleware
In the folder pages, add the SDKs to the
Step 3. Add Ninetailed to the app
Now, in the same folder, let's add the SDKs to the
In the documentation of Ninetailed, you can also find a more detailed Quick Start Guide for Developers with additional steps such as:
How to use Ninetailed Profiles in Next.js
How to integrate Google Analytics with Ninetailed
The Bottom Line
This is why personalization on the edge with Edge Functions and Ninetailed is the way to go to create personalized experiences and improve the overall user experience and SEO.