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
4 changes: 3 additions & 1 deletion src/content/en/2019/fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ Wow! Less than 2% of pages are using [`preconnect`](https://web.dev/uses-rel-pre

In fact, if you're using Google Fonts go ahead and add this to your `<head>` if it's not there already:

```<link rel="preconnect" href="https://fonts.gstatic.com/">```
```html
<link rel="preconnect" href="https://fonts.gstatic.com/">
```

### Most popular typefaces

Expand Down
9 changes: 6 additions & 3 deletions src/content/en/2019/resource-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ featured_stat_label_3: Usage of priority hints
[Examples](https://youtu.be/YJGCZCaIZkQ?t=1956) of performance improvements as a result of resource hints include:

* Jabong decreased Time to Interactive by 1.5 seconds by preloading critical scripts.
* Barefoot Wine decreased Time to Interactive of future pages by 2.7 seconds by prefetching visible links.
* Barefoot Wine decreased Time to Interactive of future pages by 2.7 seconds by prefetching visible links.
* Chrome.com decreased latency by 0.7 seconds by preconnecting to critical origins.

There are four separate resource hints supported by most browsers today: `dns-prefetch`, `preconnect`, `preload`, and `prefetch`.
Expand All @@ -51,11 +51,13 @@ The [`preload`](https://medium.com/reloading/preload-prefetch-and-priorities-in-
## Syntax

97% of resource hint usage relied on using the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tag to specify a resource hint. For example:
```

```html
<link rel="prefetch" href="shopping-cart.js">
```

Only 3% of resource hint usage used [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link) to specify resource hints. For example:

```
Link: <https://example.com/shopping-cart.js>; rel=prefetch
```
Expand Down Expand Up @@ -209,7 +211,8 @@ For newer resource types (e.g. fonts, `fetch()` requests, ES modules), the brows
</figure>

In the context of resource hints, usage of the `crossorigin` attribute enables them to match the CORS mode of the resources they are supposed to match and indicates the credentials to include in the request. For example, `anonymous` enables CORS and indicates that no credentials should be included for those cross-origin requests:
```

```html
<link rel="prefetch" href="https://other-server.com/shopping-cart.css" crossorigin="anonymous">
```

Expand Down
1,058 changes: 529 additions & 529 deletions src/content/en/2019/security.md

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/content/fr/2019/resource-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ Le rôle de [`dns-prefetch`](https://developer.mozilla.org/en-US/docs/Learn/Perf
## Syntaxe

97&nbsp;% des usages d'indices de ressources sont spécifiés par le tag [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link). Par exemple&nbsp;:
```

```html
<link rel="prefetch" href="shopping-cart.js">
```

Seuls 3&nbsp;% des indices de ressources proviennent [d'en-têtes HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link) permettant de les spécifier. Par exemple&nbsp;:

```
Link: <https://example.com/shopping-cart.js>; rel=prefetch
```
Expand Down Expand Up @@ -209,7 +211,8 @@ Pour les types de ressources plus récentes (par exemple les polices, les requê
</figure>

Dans le contexte des indices de ressources, l'utilisation de l'attribut `crossorigin` leur permet de correspondre au mode CORS des ressources auxquelles ils sont censés correspondre et indique les références à inclure dans la requête. Par exemple, `anonymous` active le mode CORS et indique qu'aucun identifiant ne doit être inclus pour ces requêtes `cross-origin`&nbsp;:
```

```html
<link rel="prefetch" href="https://other-server.com/shopping-cart.css" crossorigin="anonymous">
```

Expand Down
4 changes: 3 additions & 1 deletion src/content/ja/2019/fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ Google Fontsのドキュメントでは、Google Fonts CSSの`<link>`はペー

実際、もしあなたがGoogle Fontsを使っているのであれば、`<head>`にこれを追加してください。

```<link rel="preconnect" href="https://fonts.gstatic.com/">```
```html
<link rel="preconnect" href="https://fonts.gstatic.com/">
```

### 最も人気のある書体

Expand Down
7 changes: 5 additions & 2 deletions src/content/ja/2019/resource-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ featured_stat_label_3: 優先順位のヒントの使い方
## 文法

リソースヒント使用率の97%は、リソースヒントを指定するために[`<link>`](https://developer.mozilla.org/ja/docs/Web/HTML/Element/link)タグを使用しています。たとえば、以下のようになります。
```

```html
<link rel="prefetch" href="shopping-cart.js">
```

リソースヒント使用率のわずか3%は、リソースヒントの指定に[HTTPヘッダ](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link)を使用しました。たとえば、以下のようになります。

```
Link: <https://example.com/shopping-cart.js>; rel=prefetch
```
Expand Down Expand Up @@ -209,7 +211,8 @@ HTTPヘッダー内のリソースヒントの使用量が非常に少ないた
</figure>

リソースヒントのコンテキストでは、`crossorigin`属性を使用することで、マッチすることになっているリソースのCORSモードにマッチし、リクエストに含めるべき資格情報を示すことができます。たとえば、`anonymous`はCORSを有効にし、クロスオリジンリクエストには資格情報を含めるべきではないことを示します。
```

```html
<link rel="prefetch" href="https://other-server.com/shopping-cart.css" crossorigin="anonymous">
```

Expand Down
Loading