netlify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Netlify

Netlify

Netlify pioneered the Jamstack. In 2025, it focuses on "Platform Primitives" – giving frameworks low-level control over caching, image optimization, and routing.
Netlify是Jamstack的开创者。2025年,其重点转向「Platform Primitives」——为框架提供缓存、图片优化和路由的底层控制能力。

When to Use

适用场景

  • Static Sites: Gatsby, Hugo, Astro. Best-in-class CDN.
  • Framework Agnostic: Great support for Remix, Nuxt, SvelteKit, not just Next.js.
  • Netlify Create: Visual editor integration for CMS-driven sites.
  • 静态网站:适用于Gatsby、Hugo、Astro等,拥有顶级CDN服务。
  • 框架无关:不仅支持Next.js,还对Remix、Nuxt、SvelteKit提供出色支持。
  • Netlify Create:为CMS驱动的网站提供可视化编辑器集成。

Quick Start

快速开始

bash
npm i -g netlify-cli
bash
npm i -g netlify-cli

Run local dev environment (simulates Lambda/Edge)

运行本地开发环境(模拟Lambda/Edge环境)

netlify dev
netlify dev

Deploy

部署到生产环境

netlify deploy --prod
undefined
netlify deploy --prod
undefined

Core Concepts

核心概念

Deploy Previews

部署预览

Every Pull Request gets a URL. It stays alive forever (immutable).
每个Pull Request都会生成一个永久有效的URL(不可变)。

Netlify Drawer

Netlify协作抽屉

Collaboration tool overlay on preview builds.
覆盖在预览构建上的协作工具。

Edge Functions (Deno)

Edge Functions(基于Deno)

Run logic at the edge using Deno. Good for A/B testing, Geolocation, Auth middleware.
使用Deno在边缘节点运行逻辑,适用于A/B测试、地理定位、认证中间件等场景。

Best Practices (2025)

2025年最佳实践

Do:
  • Use
    netlify.toml
    : configure redirects, headers, and build settings as code.
  • Use Netlify Image CDN: Automatic format optimization (AVIF/WebP).
  • Use Blob Storage: For large assets / user uploads.
Don't:
  • Don't hardcode redirects in JS: Use
    _headers
    or
    _redirects
    files for CDN-level performance.
建议做法
  • 使用
    netlify.toml
    :以代码形式配置重定向、请求头和构建设置。
  • 使用Netlify图片CDN:自动进行格式优化(支持AVIF/WebP)。
  • 使用Blob存储:用于存储大型资源或用户上传文件。
不建议做法
  • 不要在JS中硬编码重定向规则:使用
    _headers
    _redirects
    文件以获得CDN级别的性能。

References

参考资料