Apr 12, 2024
Boosting Performance with Next.js and React Server Components: A geekyants.com Case Study
GeekyAnts upgraded to Next.js 13 with RSC for blazing-fast website performance & a seamless user experience. Learn the process & takeaways!
Author

Subject Matter Expert


Book a call
Table of Contents
Why Upgrade & Challenges in Transitioning
Switching to React Server Components also meant changing how we handle API calls, moving from client-side to server-side. It would require us to reorganize our data-handling approach.

How We Upgraded: Improving Page Performance
1. Adopting React Server Components



2. SVG Optimization
- next/image Component: Next.js offers a powerful built-in feature for loading and rendering various image formats, including SVGs, with efficiency and performance optimizations. It extends the HTML image element, providing seamless integration and benefits such as automatic optimization.
- next-images Package: Alternatively, you can leverage the third-party next-images package for importing images. This package supports loading images from local machines or CDNs, and it offers additional features like embedding images with small bundle sizes in Base64 encoding and caching images with content hash. However, it lacks built-in image optimization techniques.
- SVGR Package: Another third-party option is SVGR, which converts SVG images into React components. By installing SVGR as a development dependency, you can import SVGs as React components within your Next.js application.
3. Hack to Add Interactivity to Server Components

We aimed to make the menu header interactive, incorporating hover effects to show and hide items and a sticky header when scrolling, without converting the entire header into a client component. To achieve this, we've created a client component called ToggleHover.
ToggleHover.tsx
4. Device-Specific Content Delivery
Whenever we wish to ship the component based on the device, we can retrieve the header and apply the necessary conditions.
Layout.tsx
Header.tsx
5. Third-Party Scripts Optimization
(2) Using setTimeout lazy loading of Chat
We created a distinct client component for loading the chat script with a delay and then utilized it in the Footer.tsx, which serves as a server component. This improved our TTFB.
ChatScript.js
6. Code Reduction

7. Using Dynamic Imports


Key Takeaways and Best Practices
- Use creative solutions, like wrapper components, to keep your site interactive without slowing it down.
- Deliver content based on the user's device to improve their experience.
- Manage third-party scripts wisely to avoid slowing down your site.

What’s Next? Universal!
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Jun 27, 2026
Building a Resilient Hybrid-Cloud Network with WireGuard HA, Route-Based Failover, and Deep Observability

Jun 19, 2026
We Built a 114-Second AWS-to-Azure Failover. Here’s What We Learned

Jun 12, 2026
Cloud-Native and Cloud-Agnostic Are Not Ideologies; They Are Business-Stage Decisions

Jun 8, 2026
Geeklego: The Open-Source Design System Built to Work With AI

May 18, 2026
Your Vibe Code Has No Memory. DESIGN.md Fixes That.

May 14, 2026
