Summary
In this chapter, we learned how to define API routes in Next.js. Then, we learned about caching, how to revalidate the cache, and how to opt out of the cache. Next, we learned about SEO in Next.js by adding metadata to our pages, creating meaningful URLs, defining a robots.txt
file, and generating a sitemap. Finally, we learned about the Font
and Image
components, which allowed us to load fonts and images easily and optimally in our app.
There are still many more features that Next.js offers that we have not covered yet in this book, such as the following:
- Internationalization: Allows us to configure the process of routing and rendering content for multiple languages
- Middleware: Allows us to run code before requests are completed, similar to how middleware works in Express
- Serverless Node.js and Edge runtimes: Allow us to scale our apps even more by not running a full Node.js server
- Advanced routing: Allows us to model complex routing scenarios, such...