Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update netlify.mdx #6823

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/content/docs/zh-cn/guides/integrations-guide/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ declare namespace App {

这不适用于预渲染的页面。

### 在 Edge Functions 中运行 Astro 中间件
### 在 Netlify Edge Functions 上运行 Astro 中间件

任何 Astro 中间件都会在构建时应用于预渲染页面,在运行时应用于按需渲染页面。

Expand All @@ -143,7 +143,9 @@ export default defineConfig({
});
```

配置 `edgeMiddleware: true` 将会将你的中间件部署为 Edge Function,并在所有路由上运行它——包括预渲染的页面。但是,中间件中指定的 locals 不会对任何预渲染的页面可用,因为它们已经在构建时完全渲染了。
当 `edgeMiddleware` 启用时,边缘函数将为所有请求执行你的中间件代码,包括静态资产、预渲染页面和按需渲染页面。

对于按需渲染的页面,`context.locals` 对象会被 JSON 序列化并通过标头发送给无服务器函数,由该函数执行渲染。作为安全措施,除非请求来自生成的边缘函数,否则无服务器函数将拒绝服务,并返回 `403 Forbidden` 响应。

### Netlify 图片 CDN 支持

Expand Down
Loading