Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 4 additions & 6 deletions src/content/docs/ko/guides/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Netlify, Vercel, 또는 Cloudflare 환경에 배포하는 경우, 인메모리

Netlify, Vercel, Cloudflare를 지원하는 Astro의 공식 어댑터는 캐시 지시어를 각 플랫폼의 네이티브 캐시 헤더 및 무효화 API에 매핑해 주는 실험적 CDN 캐시 프로바이더를 제공합니다. 이 프로바이더들은 응답을 메모리에 저장하는 대신 호스팅 플랫폼의 엣지 네트워크로 캐시 지시어를 푸시합니다. 따라서 캐시 히트가 발생하면 서버리스 함수를 따로 실행하지 않고 CDN에서 곧바로 응답을 제공합니다.

현재 실험적 단계에서는 아래 안내와 같이 프로바이더를 직접 수동으로 활성화해야 합니다. 향후 정식 릴리스 버전에서는 Netlify 및 Vercel 프로바이더가 어댑터에 의해 자동으로 활성화될 예정입니다. Cloudflare 프로바이더의 경우 현재 프라이빗 베타 진행 중인 특정 기능이 필요합니다.
실험 단계에서는 아래와 같이 이 프로바이더들을 수동으로 활성화해야 합니다. 향후 릴리스에서는 각 어댑터에서 자동으로 활성화될 예정입니다.

각 프로바이더는 캐시된 응답에 요청 경로 태그를 자동으로 지정하므로, 태그 기반의 캐시 퍼지만 지원하는 플랫폼이더라도 [`cache.invalidate({ path })`](/ko/reference/api-reference/#cacheinvalidate) 함수가 정상적으로 동작합니다.

Expand Down Expand Up @@ -97,10 +97,6 @@ export default defineConfig({
<Since pkg="@astrojs/cloudflare" v="14.0.0" />
</p>

:::caution[프라이빗 베타]
Cloudflare 프로바이더는 현재 프라이빗 베타 단계에 있는 Cloudflare Workers Cache 기능이 필요합니다. 베타 접근 권한이 없다면 설정한 헤더가 무시되며, `cache.invalidate()`를 호출할 때 오류가 발생합니다.
:::

`@astrojs/cloudflare/cache`에서 `cacheCloudflare()`를 가져와 캐시 공급자로 설정하세요:

```js title="astro.config.mjs" ins={3, 7-9}
Expand All @@ -116,7 +112,9 @@ export default defineConfig({
});
```

이 프로바이더는 `Cloudflare-CDN-Cache-Control` 및 `Cache-Tag` 헤더를 설정합니다. Cloudflare 캐시 프로바이더가 설정되면 어댑터가 자동으로 워커 캐싱을 활성화합니다. 태그 기반 및 경로 기반 무효화가 모두 지원됩니다.
이 프로바이더는 `Cloudflare-CDN-Cache-Control` 및 `Cache-Tag` 헤더를 설정합니다. 태그 기반과 경로 기반 캐시 무효화를 모두 지원합니다.

Cloudflare 캐시 프로바이더를 사용하는 경우, 이 어댑터는 기본적으로 Cloudflare [Workers Cache](https://developers.cloudflare.com/workers/cache/)를 활성화합니다. 필요에 따라 [설정을 변경](https://developers.cloudflare.com/workers/cache/configuration/)할 수 있습니다. 예를 들어, 사이트의 새 버전을 배포할 때 기존 캐시를 유지하도록 구성할 수 있습니다.

## 캐시와 상호작용하기

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ko/guides/deploy/aws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ AWS에 대한 지속적 배포를 설정하는 방법에는 여러 가지가 있
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v6
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ko/guides/deploy/deno.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Deno를 사용하여 Astro 프로젝트에서 요청 시 렌더링을 활성화

steps:
- name: Clone repository
uses: actions/checkout@v6
uses: actions/checkout@v7

# npm을 사용하지 않나요? `npm ci`를 `pnpm i` 또는 `yarn install`로 변경하세요.
- name: Install dependencies
Expand Down Expand Up @@ -237,7 +237,7 @@ Deno를 사용하여 Astro 프로젝트에서 요청 시 렌더링을 활성화

steps:
- name: Clone repository
uses: actions/checkout@v6
uses: actions/checkout@v7

# npm을 사용하지 않나요? `npm ci`를 `pnpm i` 또는 `yarn install`로 변경하세요.
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/ko/guides/deploy/github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Astro는 아주 적은 구성으로 [프로젝트를 GitHub Pages에 배포할
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Install, build, and upload your site
uses: withastro/action@v6
# with:
Expand Down
23 changes: 23 additions & 0 deletions src/content/docs/ko/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ src/pages/test%25file.astro
src/pages/test-file.astro
```


### 제거됨: `astro:ssr-manifest` 가상 모듈 (통합 API)

<SourcePR number="14306" title="feat: integrate vite environments"/>
Expand Down Expand Up @@ -1571,6 +1572,28 @@ export default defineConfig({

<ReadMore>[제목 ID](/ko/guides/markdown-content/#제목-id)에 대해 자세히 알아보세요.</ReadMore>

### 변경됨: 라우트 pathname 정규화

<SourcePR number="14306" title="feat: integrate vite environments"/>

Astro v6부터는 라우트 정규화 과정에서 pathname이 부분적으로 디코딩될 수 있습니다. 따라서 퍼센트 인코딩된 라우트 세그먼트에서는 `Astro.url.pathname`이 `new URL(Astro.request.url).pathname`과 다를 수 있습니다.

이 변경 사항은 정규화된 pathname에서 파생되는 라우트 매개변수에도 영향을 미칩니다.

#### 무엇을 해야 하나요?

원래 인코딩된 pathname이 필요한 경우, `Astro.url.pathname` 대신 `new URL(Astro.request.url).pathname`을 사용하세요.

이전에 자동 디코딩에 의존했다면 [`decodeURI()`](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/decodeURI)를 사용하세요:

```astro title="src/pages/[slug].astro"
---
const decodedPathname = decodeURI(Astro.url.pathname);
---

<p>현재 탐색 중인 경로: {decodedPathname}</p>
```

### 변경됨: `getStaticPaths()`는 `number` 타입의 `params`를 반환할 수 없음

<SourcePR number="14586" title="fix!: disallow number in getStaticPaths params"/>
Expand Down
40 changes: 19 additions & 21 deletions src/content/docs/ko/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const { title, date } = Astro.props;
// src/pages/index.astro
import Heading from '../components/Heading.astro';
---
<Heading title="My First Post" date="09 Aug 2022" />
<Heading title="첫 번째 게시물" date="2022년 8월 9일" />
```

<ReadMore>[Markdown 및 MDX 레이아웃](/ko/guides/markdown-content/#프런트매터-layout-속성)이 props를 처리하는 방법에 대해 자세히 알아보세요.</ReadMore>
Expand Down Expand Up @@ -161,16 +161,14 @@ if (!post) {
<Since v="1.0.0" />
</p>

`url`은 현재 `request.url` 값으로 구성된 [URL](https://developer.mozilla.org/ko/docs/Web/API/URL) 객체입니다. pathname 및 origin과 같은 요청 URL의 개별 속성과 상호 작용할 때 유용합니다.
현재 `request.url`을 기반으로 생성된 정규화된 [URL](https://developer.mozilla.org/ko/docs/Web/API/URL) 객체입니다. pathname이나 origin과 같은 요청 URL의 개별 속성에 접근할 때 유용합니다.

`Astro.url`은 `new URL(Astro.request.url)`을 수행하는 것과 동일합니다.

개발 모드에서 `url`은 `localhost` URL이 됩니다. 사이트를 빌드할 때 미리 렌더링된 경로는 [`site`](/ko/reference/configuration-reference/#site) 및 [`base`](/ko/reference/configuration-reference/#base) 옵션에 기반한 URL을 받게 됩니다. `site`가 구성되지 않은 경우 미리 렌더링된 페이지도 빌드 중에 `localhost` URL을 받게 됩니다.
Astro v6부터는 라우트 정규화 과정에서 pathname이 부분적으로 디코딩될 수 있습니다. 따라서 퍼센트 인코딩된 라우트 세그먼트에서는 `Astro.url.pathname`이 `new URL(Astro.request.url).pathname`과 다를 수 있으며, 필요에 따라 [`decodeURI()`](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/decodeURI)를 사용해 직접 디코딩해야 할 수도 있습니다.

```astro title="src/pages/index.astro" "Astro.url"
<h1>The current URL is: {Astro.url}</h1>
<h1>The current URL pathname is: {Astro.url.pathname}</h1>
<h1>The current URL origin is: {Astro.url.origin}</h1>
<h1>현재 URL: {Astro.url}</h1>
<h1>현재 URL pathname: {Astro.url.pathname}</h1>
<h1>현재 URL origin: {Astro.url.origin}</h1>
```

`url`을 [`new URL()`](https://developer.mozilla.org/ko/docs/Web/API/URL/URL)의 인자로 전달하여 새 URL을 만들 수도 있습니다.
Expand Down Expand Up @@ -199,7 +197,7 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
<link
rel="alternate"
type="application/rss+xml"
title="Your Site's Title"
title="사이트 제목"
href={new URL("rss.xml", Astro.site)}
/>
```
Expand All @@ -221,7 +219,7 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
export const prerender = false; // 'server' 모드에서는 필요하지 않음
---

<div>Your IP address is: <span class="address">{Astro.clientAddress}</span></div>
<div>IP 주소: <span class="address">{Astro.clientAddress}</span></div>
```
</TabItem>
<TabItem label="context.clientAddress">
Expand All @@ -230,7 +228,7 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
import type { APIContext } from 'astro';

export function GET({ clientAddress }: APIContext) {
return new Response(`Your IP address is: ${clientAddress}`);
return new Response(`IP 주소: ${clientAddress}`);
}
```
</TabItem>
Expand Down Expand Up @@ -267,7 +265,7 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
</head>
<body>
<footer>
<p>Built with <a href="https://astro.build">{Astro.generator}</a></p>
<p><a href="https://astro.build">{Astro.generator}</a>로 제작됨</p>
</footer>
</body>
</html>
Expand Down Expand Up @@ -297,8 +295,8 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
<Tabs>
<TabItem label="Astro.request">
```astro wrap title="src/pages/index.astro" "Astro.request"
<p>Received a {Astro.request.method} request to "{Astro.request.url}".</p>
<p>Received request headers:</p>
<p>"{Astro.request.url}"에서 {Astro.request.method} 요청을 받았습니다.</p>
<p>요청 헤더:</p>
<p><code>{JSON.stringify(Object.fromEntries(Astro.request.headers))}</code></p>
```
</TabItem>
Expand Down Expand Up @@ -336,7 +334,7 @@ const socialImageURL = new URL('/images/preview.png', Astro.url);
---
if (condition) {
Astro.response.status = 404;
Astro.response.statusText = 'Not found';
Astro.response.statusText = '찾을 수 없음';
}
---
```
Expand Down Expand Up @@ -381,7 +379,7 @@ Astro.response.headers.set('Set-Cookie', 'a=b; Path=/;');
}
---

<p>User information</p>
<p>사용자 정보</p>
```
</TabItem>
<TabItem label="context.redirect()">
Expand Down Expand Up @@ -529,7 +527,7 @@ import type { MiddlewareHandler } from 'astro';

export const onRequest: MiddlewareHandler = ({ locals }, next) => {
if (!locals.title) {
locals.title = "Default Title";
locals.title = "기본 제목";
}
return next();
}
Expand All @@ -551,7 +549,7 @@ Astro 컴포넌트와 API 엔드포인트는 렌더링할 때 `locals`에서 값
import type { APIContext } from 'astro';

export function GET({ locals }: APIContext) {
return new Response(locals.title); // "Default Title"
return new Response(locals.title); // "기본 제목"
}
```
</TabItem>
Expand Down Expand Up @@ -614,9 +612,9 @@ const result = Astro.getActionResult(actions.logout);
---

<form action={actions.logout}>
<button type="submit">Log out</button>
<button type="submit">로그아웃</button>
</form>
{result?.error && <p>Failed to log out. Please try again.</p>}
{result?.error && <p>로그아웃하지 못했습니다. 다시 시도해 주세요.</p>}
```

### `callAction()`
Expand Down Expand Up @@ -1041,7 +1039,7 @@ ID를 사용하여 세션을 로드합니다. 일반적인 사용 환경에서
await Astro.session?.load(sessionId);
const cart = await Astro.session?.get('cart');
---
<h1>Your cart</h1>
<h1>장바구니</h1>
<ul>
{cart?.map((item) => (
<li>{item.name}</li>
Expand Down
Loading