Tim BenniksPosted on Jan 23, 2023
3 min read
Fast, personalized pages with Vercel Edge Middleware and Uniform
To maintain an engaging relationship with your audience and increase conversions to your site, you need personalization. However, creating personalized experiences is technically challenging. Most personalization techniques involve dynamic rendering and an origin server that holds personalization rules for end-users—a slow approach that often negates the conversions gained through personalization.
Among the many moving parts to consider, performance and scalability are tough nuts to crack. Fortunately, companies like Vercel, which recently released Edge Middleware, make those problems readily solvable for developers. With Vercel in place, you only need to choose the right tech to personalize at the CDN edge without having to grapple with the one thing that slows things down: the origin server.
The benefits of edge
The personalization process at the edge
By eliminating the origin server that is typically far away from end-users and bringing the dynamic rendering closer with Edge Middleware, you can personalize with high performance and in a decentralized manner. The only way to personalize without a central brain that knows all the personalization rules is to bring that brain into the software as a first-party tool. This is how that works:
- Create and store the configuration rules, i.e., all the criteria for personalization, in the codebase as a manifest JSON file at build time.
- Store variations of the personalized content in the codebase at build time. Since a headless CMS is generally in use, those variations are tiny JSON models in the form of components.
- The Edge Middleware has a tracker that monitors user behaviors, which are signals that users give off by doing something on the site. The Edge Middleware awards a score to the personalization criteria configured in step 1.
- The tracker automatically creates a profile of user actions and, based on the scores awarded against the various criteria, displays the right content.
- You can render the content via the Edge Middleware or in the front end at hydration time.
Another benefit of the Vercel edge is that at the edge level, the CDN knows a lot about the end-users: their location, city, device, browser version, etc. Thus, Uniform Context can prepersonalize pages with Edge Middleware according to the location or device information from the Vercel CDN.
Want to try that out for yourself? You’ll find all the details in Uniform’s documentation on Vercel’s edge-side personalization.
To recap, by combining Uniform Context on Edge Middleware with statically rendered pages (SSG/Jamstack), you can create highly dynamic, personalized pages that load in less than a minute. In the past, Uniform offered dynamic personalization features through Vercel ESI. Edge Middleware now gives you a much more flexible and intuitive model for implementing personalization at scale.
For further reference, see Uniform’s documentation or join our Discord Server to discuss topics of interest with the Uniform community.