---
title: How I Sped Up the neon.tech Homepage from ~400ms to ~90ms
description: How I cut the neon.tech homepage's time to first byte from about 400ms to about 90ms, starting with moving real-time logic to middleware.
url: https://rishi.app/blog/how-i-sped-up-the-neon-tech-homepage-from-400ms-to-90ms
author: Rishi Raj Jain
published_at: 2025-06-06T12:54:14.268Z
updated_at: 2026-11-15T05:40:02.225Z
---

# How I Sped Up the neon.tech Homepage from ~400ms to ~90ms

I recently optimized the performance of [neon.tech](https://neon.tech) (by [@neondatabase](https://twitter.com/neondatabase)) homepage and cut the TTFB from **\~400ms** to **\~90ms**:

![Before and After Latency Report](https://rishi.app/assets/blog/how-i-sped-up-the-neon-tech-homepage-from-400ms-to-90ms/neon-before-after.webp)

📊 (TTFB numbers via [@SpeedVitals](https://twitter.com/SpeedVitals))

Now, let's dive into magical changes below one by one:

- [1. Moved Real-Time Logic to Middleware](#1-moved-real-time-logic-to-middleware)
- [2. Removed Page Revalidation](#2-removed-page-revalidation)
- [3. Added Shared Cache Headers on Vercel](#3-added-shared-cache-headers-on-vercel)

<hr class="w-full" />

## 1. Moved Real-Time Logic to Middleware

Previously, every request was **SSR'd** just to check if a user should be redirected to `console.neon.tech`.

Now, this logic runs in a **lightweight middleware** using [Next.js middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware), which performs runtime checks much more efficiently.

<hr class="w-full" />

## 2. Removed Page Revalidation

Disabled revalidation logic on the homepage and its alias `/home`:

```diff
- export const revalidate = 60;
+ export const revalidate = false;
```

<hr class="w-full" />

## 3. Added Shared Cache Headers on Vercel

Configured the cache headers in `vercel.json` to enable **shared cache responses**:

```json
{
  "source": "/",
  "headers": [
    {
      "key": "Cache-Control",
      "value": "max-age=0, s-maxage=31536000"
    }
  ]
},
{
  "source": "/home",
  "headers": [
    {
      "key": "Cache-Control",
      "value": "max-age=0, s-maxage=31536000"
    }
  ]
}
```

<hr class="w-full" />

## 🌍 Global Performance Results

And that did the trick! Here's how the latency now looks globally (via [@OpenStatusHQ](https://twitter.com/OpenStatusHQ)):
![Global Latency Report](https://rishi.app/assets/blog/how-i-sped-up-the-neon-tech-homepage-from-400ms-to-90ms/neon-after-global.webp)

## Summary

With just a few key changes:

* Middleware instead of SSR
* No revalidation
* Smart caching headers

…we got the homepage blazing fast!

---

This is the Markdown version of https://rishi.app/blog/how-i-sped-up-the-neon-tech-homepage-from-400ms-to-90ms. Every page on this site is listed with a summary at https://rishi.app/sitemap.md.
