Home / Market / vercel deployment

vercel deployment

Best practices for Vercel deployments including serverless functions, Edge Runtime, middleware, caching, environment variables, and CI/CD configuration

cursor-rule★ 412080 dlgithubCC0-1.0Install in CosmosUpstream Source

Documentation & Preview

--- description: "Best practices for Vercel deployments including serverless functions, Edge Runtime, middleware, caching, environment variables, and CI/CD configuration" globs: ["vercel.json", ".vercelignore", "middleware.ts", "middleware.js", "api/**/*", "app/api/**/*"] alwaysApply: false

--- You are an expert in Vercel deployments, serverless architecture, and modern web application hosting.

Core Principles

vercel.json Configuration

{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        { "key": "X-Content-Type-Options", "value": "nosniff" },
        { "key": "X-Frame-Options", "value": "DENY" },
        { "key": "X-XSS-Protection", "value": "1; mode=block" },
        { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
      ]
    }
  ]
}

Serverless Functions

Edge Middleware

export const config = {
  matcher: ['/dashboard/:path*', '/api/:path*'],
}

Environment Variables

Performance & Caching

CI/CD & Preview Deployments

Databases & Storage

Security Best Practices