Skip to content

Commit b70670e

Browse files
docs: translate prefetchDNS.md to Русский
1 parent 2958f53 commit b70670e

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

src/content/reference/react-dom/prefetchDNS.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: prefetchDNS
44

55
<Intro>
66

7-
`prefetchDNS` lets you eagerly look up the IP of a server that you expect to load resources from.
7+
`prefetchDNS` позволяет заранее выполнить поиск IP-адреса сервера, с которого вы ожидаете загрузить ресурсы.
88

99
```js
1010
prefetchDNS("https://example.com");
@@ -16,11 +16,11 @@ prefetchDNS("https://example.com");
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## Справочник {/*reference*/}
2020

2121
### `prefetchDNS(href)` {/*prefetchdns*/}
2222

23-
To look up a host, call the `prefetchDNS` function from `react-dom`.
23+
Чтобы выполнить поиск хоста, вызовите функцию `prefetchDNS` из `react-dom`.
2424

2525
```js
2626
import { prefetchDNS } from 'react-dom';
@@ -32,34 +32,34 @@ function AppRoot() {
3232

3333
```
3434

35-
[See more examples below.](#usage)
35+
[См. больше примеров ниже.](#usage)
3636

37-
The prefetchDNS function provides the browser with a hint that it should look up the IP address of a given server. If the browser chooses to do so, this can speed up the loading of resources from that server.
37+
Функция `prefetchDNS` предоставляет браузеру подсказку о том, что ему следует выполнить поиск IP-адреса данного сервера. Если браузер решит это сделать, это может ускорить загрузку ресурсов с этого сервера.
3838

39-
#### Parameters {/*parameters*/}
39+
#### Параметры {/*parameters*/}
4040

41-
* `href`: a string. The URL of the server you want to connect to.
41+
* `href`: строка. URL-адрес сервера, к которому вы хотите подключиться.
4242

43-
#### Returns {/*returns*/}
43+
#### Возвращаемое значение {/*returns*/}
4444

45-
`prefetchDNS` returns nothing.
45+
`prefetchDNS` ничего не возвращает.
4646

47-
#### Caveats {/*caveats*/}
47+
#### Ограничения {/*caveats*/}
4848

49-
* Multiple calls to `prefetchDNS` with the same server have the same effect as a single call.
50-
* In the browser, you can call `prefetchDNS` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
51-
* In server-side rendering or when rendering Server Components, `prefetchDNS` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
52-
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
53-
* There is no benefit to prefetching the same server the webpage itself is hosted from because it's already been looked up by the time the hint would be given.
54-
* Compared with [`preconnect`](/reference/react-dom/preconnect), `prefetchDNS` may be better if you are speculatively connecting to a large number of domains, in which case the overhead of preconnections might outweigh the benefit.
49+
* Многократные вызовы `prefetchDNS` с одним и тем же сервером имеют тот же эффект, что и один вызов.
50+
* В браузере вы можете вызывать `prefetchDNS` в любой ситуации: во время рендеринга компонента, в эффекте, в обработчике событий и т. д.
51+
* При серверном рендеринге или при рендеринге серверных компонентов `prefetchDNS` имеет эффект только в том случае, если вы вызываете его во время рендеринга компонента или в асинхронном контексте, возникшем при рендеринге компонента. Все остальные вызовы будут проигнорированы.
52+
* Если вы знаете конкретные ресурсы, которые вам понадобятся, вы можете вместо этого вызвать [другие функции](/reference/react-dom/#resource-preloading-apis), которые немедленно начнут загрузку ресурсов.
53+
* Нет смысла предварительно запрашивать DNS для того же сервера, на котором размещена сама веб-страница, поскольку он уже был найден к моменту предоставления подсказки.
54+
* По сравнению с [`preconnect`](/reference/react-dom/preconnect), `prefetchDNS` может быть лучше, если вы спекулятивно подключаетесь к большому количеству доменов, в этом случае накладные расходы на предварительное соединение могут перевесить выгоду.
5555

5656
---
5757

58-
## Usage {/*usage*/}
58+
## Использование {/*usage*/}
5959

60-
### Prefetching DNS when rendering {/*prefetching-dns-when-rendering*/}
60+
### Предварительный запрос DNS при рендеринге {/*prefetching-dns-when-rendering*/}
6161

62-
Call `prefetchDNS` when rendering a component if you know that its children will load external resources from that host.
62+
Вызывайте `prefetchDNS` при рендеринге компонента, если вы знаете, что его дочерние элементы будут загружать внешние ресурсы с этого хоста.
6363

6464
```js
6565
import { prefetchDNS } from 'react-dom';
@@ -70,9 +70,9 @@ function AppRoot() {
7070
}
7171
```
7272

73-
### Prefetching DNS in an event handler {/*prefetching-dns-in-an-event-handler*/}
73+
### Предварительный запрос DNS в обработчике событий {/*prefetching-dns-in-an-event-handler*/}
7474

75-
Call `prefetchDNS` in an event handler before transitioning to a page or state where external resources will be needed. This gets the process started earlier than if you call it during the rendering of the new page or state.
75+
Вызывайте `prefetchDNS` в обработчике событий перед переходом на страницу или в состояние, где потребуются внешние ресурсы. Это позволит начать процесс раньше, чем если бы вы вызвали его во время рендеринга новой страницы или состояния.
7676

7777
```js
7878
import { prefetchDNS } from 'react-dom';
@@ -86,4 +86,4 @@ function CallToAction() {
8686
<button onClick={onClick}>Start Wizard</button>
8787
);
8888
}
89-
```
89+
```

0 commit comments

Comments
 (0)