Sam is a high school student in Singapore who enjoys using his weekends to build weird and wonderful side projects whilst also attempting to finish his homework. He enjoys visualizing data, exploring how he can build websites to make his community a better place and making people smile.
Next.js’ recent 12.0 release included a new beta feature: middleware. For a detailed explanation, you can read all about it in Sam’s previous article, “Next.js Wildcard Subdomains”. This article, on the other hand, dives into the overall concept of middleware and how handy it can be in building things.
Hosting with a wildcard subdomain enables your users to visit your site on any subdomain of your domain (*.example.com), and as you can imagine, we can use this to create unique user experiences which we’ll be exploring in this article through a Next.js lens.
When paired with ISR and Next.js’ API routes, SWR can be used to create a responsive user experience. In this article, Sam Poder explains what SWR is, where to use it (and where not), and how to build a website by using Incremental Static Regeneration.