Skip to main content
Welcome to the Astro Vercel Boilerplate - a production-ready starter template that showcases the best of Astro’s capabilities when deployed on Vercel’s edge infrastructure.

What is this boilerplate?

This boilerplate is a comprehensive example of an Astro site optimized for Vercel deployment. It demonstrates modern web development patterns including server-side rendering, edge functions, and advanced caching strategies - all with zero configuration required.

Key Features

This boilerplate comes packed with features that leverage both Astro and Vercel’s powerful capabilities:

Server-Side Rendering (SSR)

Dynamic pages rendered at request time using Vercel Edge Functions for ultra-low latency.

Incremental Static Regeneration (ISR)

Update static content without redeploying. Pages are cached for 24 hours by default and can be revalidated on-demand.

Edge Functions

API endpoints that run on Vercel’s Edge Network, close to your users for minimal latency.

Image Optimization

Automatic image optimization with WebP format conversion and responsive sizing.

Web Analytics

Built-in Vercel Analytics and Speed Insights for monitoring performance and user behavior.

Edge Middleware

Request processing at the edge before pages are rendered, perfect for authentication, redirects, and more.

Why Astro with Vercel?

Astro and Vercel are a perfect match for building fast, modern web applications:
  • Zero JavaScript by default: Astro ships zero JavaScript by default, resulting in faster page loads
  • Edge-first architecture: Vercel’s edge network ensures your content is served from locations closest to your users
  • Flexible rendering: Mix static, SSR, and ISR pages in the same project based on your needs
  • Developer experience: Hot module reloading, TypeScript support, and intuitive file-based routing
  • Production-ready: Built-in analytics, image optimization, and performance monitoring out of the box

Demo Pages Included

The boilerplate includes several demo pages showcasing different rendering strategies:
  • / - Server-rendered homepage displaying your IP address and city using edge functions
  • /ssr - Server-side rendered page showing the current server time
  • /isr - Incremental static regeneration with on-demand revalidation
  • /image - Demonstrates Vercel Image Optimization with Astro’s Image component
  • /edge.json - API endpoint returning JSON data from the edge

What’s Next?

Quickstart

Get up and running in minutes with our step-by-step guide

Deployment

Learn how to deploy your site to Vercel

Build docs developers (and LLMs) love